# From a statement | Badlen Docs

> The OFX, QIF or CSV file your bank hands out, read into one account, shown line by line against what it already holds, and written only once you confirm.

Source: https://docs.badlen.fr/getting-data-in/from-a-statement/

Download the statement from your bank as OFX, QIF or CSV, then open the **Account statement**
tile of the add screen, `/ajouter/releve`, or **Import a statement** on the account's **Movements**
tab, which opens the same screen with that account already chosen. Badlen shows what the file
holds against what the account already has, and writes nothing until you confirm.

It needs no key and no client: the file goes from your browser to your own Badlen server, which
keeps the operations, not the file. It works for any account whose bank lets you download a
statement. A current account can also be read [from your bank](https://docs.badlen.fr/getting-data-in/from-your-bank/)
four times a day, and a PDF statement goes through
[your assistant](https://docs.badlen.fr/getting-data-in/with-your-assistant/).

## The formats it reads

| Format      | What Badlen takes from it                                                                                                              |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| OFX and QFX | each operation's posted date, amount and name, the memo after the name, the statement's currency                                       |
| QIF         | each record's date, amount and payee, the memo after the payee                                                                         |
| CSV         | the columns you map: a date, a label, either one signed amount or a debit and a credit column, and a fee column if the bank writes one |

The file may be in UTF-8, with or without its byte order mark, in Latin-1 (Windows-1252),
which is what many French banks still write, or in UTF-16, which is what a spreadsheet saves
as Unicode text; lines may end the Windows way or the Unix way.
Amounts are read with a comma or a point for decimals, with spaces or points between the
thousands (`1 234,56`, `1.234,56`), and with the minus sign in front, behind or as
brackets. Dates are read day first (`31/01/2026`), month first (`01/31/2026`) or year first
(`2026-01-31`), with two- or four-digit years.

## The steps

1. **Choose the account and the file.** Drop the file on the box or pick it. The file is
   read straight away and nothing is written yet.
2. **Check the columns, for a CSV.** Badlen guesses the separator, whether the first row
   names the columns, which column holds the date, the label and the amounts, how dates are
   written, which decimal mark is used and whether a column holds a fee. Lines written above
   the table, an account number or a period, are skipped. If a guess is wrong, change it
   under **Preview before importing** and the preview is read again. The mapping you import
   with is kept for that account, and its next statement is read the same way when it has the
   same columns; a file of another shape is guessed afresh. The dates are read on every line:
   when none says whether the day comes before the month, or they contradict the order kept for
   this account, the preview says so; likewise when no amount says whether a comma or a point
   marks the decimals, or they contradict the separator kept. A QIF has no columns, but the
   preview then offers the order to pick.
3. **Read the preview.** Four counts: the operations **To import**, those **Already in the
   account**, those **Deleted earlier**, and the **Unreadable lines**, each named with its
   line number and what could not be read. The first hundred operations are listed with
   their verdict. Above them, what deserves a look before writing: a statement that starts
   before the newest operation the account already holds, or a line with the same date and
   amount as an existing one under another label.
4. **Import, or cancel.** **Import** writes the new operations and files them with your
   [categorization rules](https://docs.badlen.fr/your-wealth/transactions/#categorize-automatically), the same ones the **Categorize automatically**
   button applies. **Cancel** drops the file and leaves the account as it was.

## Twice the same statement

Sending the same statement again, or two statements that overlap, writes each operation
once. Every line is fingerprinted from its date, amount and label, and a line the account
already holds is skipped. Two identical operations on the same day in one statement are
both kept, because a statement that shows them twice means there were two.

A line you deleted after an earlier import stays deleted: the next import of the same
statement counts it among **Deleted earlier** and does not write it again. This is the same
check every import goes through, the assistant's included; [With your
assistant](https://docs.badlen.fr/getting-data-in/with-your-assistant/#the-import-route) describes it.

## The limits

- **Size.** 5 MB per file and 20,000 operations, the bound a batch has on the
  [REST API](https://docs.badlen.fr/automation/api-reference/). A year of a busy current account is a few hundred
  kilobytes.
- **Euros only.** Nothing converts a currency, so an OFX file whose statement declares
  another one has each of its operations listed among the unreadable lines instead of
  counted as euros. Every other file is read in euros.
- **Splits and categories in the file are ignored.** A QIF split keeps its total, and the
  category a bank or another program wrote is not read: filing is your rules' work.
- **Dates and amounts.** A day the calendar does not have, one before 1900 or after tomorrow,
  or an amount too large to store is listed among the unreadable lines rather than written.
- **One account per file.** An OFX file holding the statements of several accounts is
  refused, with their numbers named: export them one at a time and import each into its
  own account.
- **Payments that never happened.** A row a CSV's state column marks as reverted, declined,
  cancelled or pending is listed among the unreadable lines rather than written. A fee
  column is taken off the amount it sits beside.

## When the file is refused

| What Badlen says                                                                                   | What to do                                                                                                                           |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| _This file is over 5 MB: export a shorter period._                                                 | Download the statement again over fewer months                                                                                       |
| _This file reads neither as an OFX or QIF statement nor as a CSV table of at least three columns._ | The file is something else, a PDF or a spreadsheet's own format: export it again as OFX, QIF or CSV, or give a PDF to your assistant |
| _This file holds the statements of several accounts…_                                              | Export each account on its own from your bank, then import each into its own account                                                 |
| _No readable operation in this file: nothing was written._                                         | Every line landed among the unreadable lines: check the column mapping and how dates are written                                     |
| A line among **Unreadable lines**                                                                  | Its sentence names the line and the value; the other lines still import                                                              |
