xsv input -d '|'

Category: Data Science & Analysis

xsv input -d '|'

Normalize pipe-delimited stdin into standard CSV

The input command guesses or accepts a delimiter with -d and normalizes the stream into standard quoted CSV on stdout. Run it as a pipe stage, for example cat data.psv | xsv input -d '|', when a file uses a non-comma separator. This is the first step before other xsv commands that expect commas. The -d flag also accepts tabs and other single characters.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.