Manual · The book

# Import & export

CSV, JSON, XML — mapping, key fields, and running it again next month.

## The import window

Choose a file and the window shows the pairing as a picture: the file's columns on the left, your fields on the right, a wire between each pair — a column with no home has a dashed pale wire, so an unmatched file looks wrong before a word is read. The separator of a CSV is detected by the only honest rule: the one that gives the same number of columns on every line. Encodings are detected too — yesterday's exports are `windows1252` more often than anybody hopes.

The file itself on top, one band per column, a wire to the field it lands in — and a footer that counts what will happen before it happens.

## Importing twice — the key field

The import that runs again next month needs a key field (the customer number, the article code): rows whose key exists update, new keys insert. Without one, the second run doubles every row — the window says so rather than letting it happen quietly. Every imported row passes the table's own rules, exactly like typing.

## Exports

CSV, JSON or XML, the fields you choose in the order you drag — and the window shows the real rows it will write, in the chosen columns, so ticking a field off is visible in the picture. From a list, Export writes the selection or everything the list shows.

The rows that will be written, in the columns and the order chosen — read-before-write in the window where it is easiest to leave out.

## Presets

Both windows keep their saved settings on the same two shelves as every editor: yours ship read-only inside the application, the end user's live beside their data. An import preset saves the shape — mapping, key field, separator — never the file path: paths are about one machine.

## Relationships in imported data

An imported invoice finds its customer by containment — the import asks which imported values live in which table — never by guessing from column names.