fmt
Reformats tabular data as CSV with an explicit dialect (delimiter, quote style, escape character, line endings).
# Change delimiter
undatum fmt data.csv --delimiter ";" --output output.csv
# Change quote style
undatum fmt data.csv --quote always --output output.csv
# Change escape character
undatum fmt data.csv --escape backslash --output output.csv
# Change line endings
undatum fmt data.csv --line-ending crlf --output output.csv
Without --output, CSV is written to stdout.
Options
| Flag | Values | Default |
|---|---|---|
--delimiter | Any single character | , |
--quote | minimal, always, none, nonnumeric | minimal |
--escape | double, backslash, none | double |
--line-ending | unix, windows, crlf, mac | unix |
--quotechar | CSV quote character | iterabledata default " |
--encoding | Text encoding | utf8 |
--output | Output path | stdout |
Also accepts --table, --flatten-nested, --on-error, and --error-log (shared options).
Reference
Reads: CSV and TSV · Writes: CSV with the chosen dialect · Memory: streaming, two passes over the input · Engines: python
undatum fmt [OPTIONS] INPUT_FILE
| Argument | Description |
|---|---|
INPUT_FILE | Path to input file. (required) |
| Option | Description | Default |
|---|---|---|
-o, --output TEXT | Optional output file path. If not specified, prints to stdout. | |
-d, --delimiter TEXT | CSV delimiter character (default: comma). | , |
--quotechar TEXT | CSV quote character (iterabledata default '"' when omitted). | |
--quote TEXT | Quote style: 'minimal' (default), 'always', 'none', or 'nonnumeric'. | minimal |
--escape TEXT | Escape character: 'double' (default), 'backslash', or 'none'. | double |
--line-ending TEXT | Line ending: 'unix' (default), 'windows', 'crlf', or 'mac'. | unix |
--encoding TEXT | File encoding (e.g., 'utf8', 'latin1'). | |
--verbose / --no-verbose | Enable verbose logging output. | --no-verbose |
-F, --format-in TEXT | Override input file format detection (e.g., 'csv', 'jsonl'). | |
--table, --sheet TEXT | Table or sheet name for multi-table sources (Excel, SQLite, lakehouse). | |
--start-page INTEGER | Sheet index (0-based) for Excel files. | 0 |
--trust | Acknowledge pickle deserialization risk when reading pickle sources. | |
--on-error TEXT | Parse-error policy: raise (default), skip, or warn. | |
--error-log TEXT | Append parse errors as JSONL (use with --on-error skip or warn). | |
--flatten-nested | Unfold nested dict / array-of-dict fields into dotted paths (e.g. city.lat). | |
--max-nested-depth INTEGER | With --flatten-nested, maximum nest depth to unfold (engine default 5). | |
--keep-nested-parents / --no-keep-nested-parents | With --flatten-nested, keep parent dict/array fields alongside dotted children. | --keep-nested-parents |
See also shared options.