Skip to main content

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​

FlagValuesDefault
--delimiterAny single character,
--quoteminimal, always, none, nonnumericminimal
--escapedouble, backslash, nonedouble
--line-endingunix, windows, crlf, macunix
--quotecharCSV quote characteriterabledata default "
--encodingText encodingutf8
--outputOutput pathstdout

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
ArgumentDescription
INPUT_FILEPath to input file. (required)
OptionDescriptionDefault
-o, --output TEXTOptional output file path. If not specified, prints to stdout.
-d, --delimiter TEXTCSV delimiter character (default: comma).,
--quotechar TEXTCSV quote character (iterabledata default '"' when omitted).
--quote TEXTQuote style: 'minimal' (default), 'always', 'none', or 'nonnumeric'.minimal
--escape TEXTEscape character: 'double' (default), 'backslash', or 'none'.double
--line-ending TEXTLine ending: 'unix' (default), 'windows', 'crlf', or 'mac'.unix
--encoding TEXTFile encoding (e.g., 'utf8', 'latin1').
--verbose / --no-verboseEnable verbose logging output.--no-verbose
-F, --format-in TEXTOverride input file format detection (e.g., 'csv', 'jsonl').
--table, --sheet TEXTTable or sheet name for multi-table sources (Excel, SQLite, lakehouse).
--start-page INTEGERSheet index (0-based) for Excel files.0
--trustAcknowledge pickle deserialization risk when reading pickle sources.
--on-error TEXTParse-error policy: raise (default), skip, or warn.
--error-log TEXTAppend parse errors as JSONL (use with --on-error skip or warn).
--flatten-nestedUnfold nested dict / array-of-dict fields into dotted paths (e.g. city.lat).
--max-nested-depth INTEGERWith --flatten-nested, maximum nest depth to unfold (engine default 5).
--keep-nested-parents / --no-keep-nested-parentsWith --flatten-nested, keep parent dict/array fields alongside dotted children.--keep-nested-parents

See also shared options.