xsv fmt -t '|'

Category: Data Science & Analysis

xsv fmt -t '|'

Convert CSV on stdin to pipe-delimited output

The fmt command reformats CSV, and -t '|' changes the output delimiter to a pipe character. Run it as a pipe stage, for example cat data.csv | xsv fmt -t '|', to convert a comma-separated file into pipe-delimited text. The -t flag is short for --out-delimiter. Output quoting is adjusted automatically so delimiters inside fields stay safe.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.