Documentation ¶
Overview ¶
Csv2tsv converts comma-separated value (CSV) input to tab-separated value (TSV) output.
Usage:
csv2tsv [-c comment] [-o output] [-t tab] [file...]
Csv2tsv reads the named files, or else standard input, as comma-separated value data and prints that data in tab-separated form to standard output.
The -c flag specifies a comment character. Input lines beginning with this character will be elided.
The -o flag specifies the name of a file to write instead of using standard output.
The -t flag specifies a string to use in place of the tab character.
Before printing the data, csv2tsv replaces every newline or occurrence of the tab string with a single space.
Example ¶
To print the second and fourth fields of a CSV file using awk:
csv2tsv data.csv | awk -F'\t' '{print $2, $4}'
Click to show internal directories.
Click to hide internal directories.