CSVFORMAT(1)
β¨ hey bestie, welcome to CSVFORMAT(1) β aka csvformat(1) β from csvkit β¨
π NAME π
csvformat β literally the csvformat Documentation. that's the name, that's the vibe. π
β¨ DESCRIPTION β¨
okay so the whole point is: Convert a CSV file to a custom output format.: π¦
here's the synopsis, exactly as it should be typed, no cap:
usage: csvformat [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
[-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING]
[-L LOCALE] [-S] [-H] [-K SKIP_LINES] [-v] [-l] [--zero] [-V]
[-E] [-D OUT_DELIMITER] [-T] [-A] [-Q OUT_QUOTECHAR]
[-U {0,1,2,3}] [-B] [-P OUT_ESCAPECHAR]
[-M OUT_LINETERMINATOR]
[FILE]
π positional arguments π
FILEβ the CSV file to operate on. If you omit it, it will accept input as piped data viaSTDIN. she's flexible like that. π
πΈ optional arguments πΈ
-h,--helpβ show this help message and exit. iconic.-E,--skip-headerβ do not output a header row. no header, no problem.-D OUT_DELIMITER,--out-delimiter OUT_DELIMITERβ the delimiting character of the output file. pick your separator, bestie.-T,--out-tabsβ says the output file is delimited with tabs. it overrides-D. tabs ate.-A,--out-asvβ says the output file is delimited with the ASCII unit separator and record separator. it overrides-T,-Dand-M. asv is the moment.-Q OUT_QUOTECHAR,--out-quotechar OUT_QUOTECHARβ the character used to quote strings in the output file. quote her.-U {0,1,2,3},--out-quoting {0,1,2,3}β quoting style used in the output file:0quote minimal,1quote all,2quote non-numeric,3quote none. choose your fighter.-B,--out-no-doublequoteβ whether or not double quotes are doubled in the output file. double or not, that's the question.-P OUT_ESCAPECHAR,--out-escapechar OUT_ESCAPECHARβ the character used to escape the delimiter in the output file if--quoting 3("Quote None") is specified and to escape theQUOTECHARif--out-no-doublequoteis specified. escape room energy.-M OUT_LINETERMINATOR,--out-lineterminator OUT_LINETERMINATORβ the character used to terminate lines in the output file. bye line, bye.
also the synopsis has these common arguments: -d DELIMITER, -t, -q QUOTECHAR, -u {0,1,2,3}, -b, -p ESCAPECHAR, -z FIELD_SIZE_LIMIT, -e ENCODING, -L LOCALE, -S, -H, -K SKIP_LINES, -v, -l, --zero, -V. their deets are in the common tools docs, iykyk.
See also: Arguments common to all tools.
π EXAMPLES π
- Convert a comma-separated file to a pipe-delimited file:
csvformat -D "|" examples/dummy.csv
- Convert to carriage return line-endings:
csvformat -M $'\r' examples/dummy.csv
- Convert to a tab-delimited file (TSV) with no doubling of double quotes:
printf 'key,value\n1,"a ""quoted"" string"' | csvformat -T -Qπ
- To avoid escaping quote characters when using
--quoting 3, add--out-quotechar "":
csvformat -u3 -U3 -Qπ examples/optional_quote_characters.csv
π AUTHOR π
Christopher Groskopf and contributors. the icons, the legends. π
π COPYRIGHT π
2016, Christopher Groskopf and James McKinney. periodt. π«Ά
kisses bestie, this was csvkit version 2.2.0, Aug 16, 2024. bye! π
β¨
π¦ where this page comes from
- arch rolling: csvkit 2.2.0-2 Β· MIT
- nixos 26.05: csvkit 2.2.0
- nixpkgs unstable: csvkit 2.2.0
- ubuntu resolute: csvkit 2.2.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms