# Importing and exporting tables (/docs/guides/import-export-tables)



A decision table can round-trip through a spreadsheet: export the rules to Excel (`.xlsx`) or CSV
and import them back. The XLSX reader and writer are a few hundred lines in `core` with no
dependency.

## File layout [#file-layout]

* One row per rule.
* Columns: `description`, `enabled`, `priority`, `in:<key>`, `out:<key>`, …
* Cells are written the way the editor shows them, so a human can read the file:

```
> 1000       1000..5000        in [DO, RU]        != US        matches ^A        expr: amount * 2
```

## Import [#import]

An import **replaces the rules**. The hit policy and defaults stay. The import:

* Keeps the types of known columns.
* Adds unknown columns typed from their values.
* Names the row and column of anything it cannot read.

## Export [#export]

The editor exports to both `.xlsx` and `.csv`. The format matches the import format exactly, so
exports can be re-imported without surprises. A README-in-one change keeps both in sync.
