Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 2.78 KB

File metadata and controls

61 lines (42 loc) · 2.78 KB

fmt

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.

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. If set to "T", uses tab as the delimiter. ,
 ‑‑crlf  flag Use '\r\n' line endings in the output.
 ‑‑ascii  flag Use ASCII field and record separators. Use Substitute (U+00A1) as the quote character.
 ‑‑quote  string The quote character to use. "
 ‑‑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 instead of stdout.
 ‑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