fmt
May 31, 2026 · View on GitHub
Reformat a CSV with different delimiters, record terminators or quoting rules. (Supports ASCII delimited data.)
Table of Contents | Source: src/cmd/fmt.rs
Description | Usage | Fmt Options | Common Options
Description ↩
Formats CSV data with a custom delimiter or CRLF line endings.
Generally, all commands in qsv output CSV data in a default format, which is the same as the default format for reading CSV data. This makes it easy to pipe multiple qsv commands together. However, you may want the final result to have a specific delimiter or record separator, and this is where 'qsv fmt' is useful.
For examples, see https://github.com/dathere/qsv/blob/master/tests/test_fmt.rs. See also https://github.com/dathere/qsv/wiki/Transform-and-Reshape#fmt
Usage ↩
qsv fmt [options] [<input>]
qsv fmt --help
Fmt Options ↩
| Option | Type | Description | Default |
|---|---|---|---|
‑t,‑‑out‑delimiter | string | The field delimiter for writing CSV data. Must be a single character. "T" or "\t" can be used as shortcuts for tab. | , |
‑‑crlf | flag | Use '\r\n' line endings in the output. | |
‑‑ascii | flag | Use ASCII field/record separators: Unit Separator (U+001F) for fields and Record Separator (U+001E) for records. Substitute (U+001A) is used as the quote character. | |
‑‑quote | string | The quote character to use. Must be a single character. | " |
‑‑quote‑always | flag | Put quotes around every value. | |
‑‑quote‑never | flag | Never put quotes around any value. | |
‑‑escape | string | The escape character to use. When not specified, quotes are escaped by doubling them. | |
‑‑no‑final‑newline | flag | Do not write a newline at the end of the output. This makes it easier to paste the output into Excel. |
Common Options ↩
| Option | Type | Description | Default |
|---|---|---|---|
‑h,‑‑help | flag | Display this message | |
‑o,‑‑output | string | Write output to | |
‑d,‑‑delimiter | string | The field delimiter for reading CSV data. Must be a single character. (default: ,) |
Source: src/cmd/fmt.rs
| Table of Contents | README