headers

May 31, 2026 · View on GitHub

Show the headers of a CSV. Or show the intersection of all headers between many CSV files.

Table of Contents | Source: src/cmd/headers.rs | 🗄️

Description | Usage | Arguments | Headers Options | Common Options

Description ↩

Prints the fields of the first row in the CSV data.

These names can be used in commands like 'select' to refer to columns in the CSV data.

Note that multiple CSV files may be given to this command. This is useful with the --union flag.

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

Usage ↩

qsv headers [options] [<input>...]
qsv headers --help

Arguments ↩

Argument Description
 <input> The CSV file(s) to read. Use '-' for standard input. If input is a directory, all files in the directory will be read as input. If the input is a file with a '.infile-list' extension, the file will be read as a list of input files. If the input are snappy-compressed files(s), it will be decompressed automatically.

Headers Options ↩

     Option     TypeDescriptionDefault
 ‑j,
‑‑just‑names 
flagOnly show the header names (hide column index). This is automatically enabled if more than one input is given.
 ‑J,
‑‑just‑count 
flagOnly show the number of headers.
 ‑‑union flagShows the union of headers across all inputs (deduplicated).
 ‑‑trim flagTrim leading/trailing space, tab, and quote characters from header name.

Common Options ↩

     Option     TypeDescriptionDefault
 ‑h,
‑‑help 
flagDisplay this message
 ‑d,
‑‑delimiter 
stringThe field delimiter for reading CSV data. Must be a single character. (default: ,)

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