flatten

May 31, 2026 · View on GitHub

A flattened view of CSV records. Useful for viewing one record at a time. e.g. qsv slice -i 5 data.csv | qsv flatten.

Table of Contents | Source: src/cmd/flatten.rs

Description | Usage | Flatten Options | Common Options

Description

Prints flattened records such that fields are labeled separated by a new line. This mode is particularly useful for viewing one record at a time. Each record is separated by a special '#' character (on a line by itself), which can be changed with the --separator flag.

There is also a condensed view (-c or --condense) that will shorten the contents of each field to provide a summary view.

For examples, see https://github.com/dathere/qsv/blob/master/tests/test_flatten.rs. See also https://github.com/dathere/qsv/wiki/Selection-and-Inspection#flatten

Usage

qsv flatten [options] [<input>]
qsv flatten --help

Flatten Options

      Option       TypeDescriptionDefault
 ‑c,
‑‑condense 
integerLimits the length of each field to the value specified. If the field is UTF-8 encoded, then refers to the number of code points. Otherwise, it refers to the number of bytes.
 ‑f,
‑‑field‑separator 
stringA string of characters to write between a column name and its value.
 ‑s,
‑‑separator 
stringA string of characters to write after each record. When non-empty, a new line is automatically appended to the separator.#

Common Options

     Option     TypeDescriptionDefault
 ‑h,
‑‑help 
flagDisplay this message
 ‑n,
‑‑no‑headers 
flagWhen set, the first row will not be interpreted as headers. When set, the name of each field will be its index.
 ‑d,
‑‑delimiter 
stringThe field delimiter for reading CSV data. Must be a single character. (default: ,)

Source: src/cmd/flatten.rs | Table of Contents | README