1CSVFORMAT(1) csvkit CSVFORMAT(1)
2
3
4
6 csvformat - csvformat Documentation
7
9 Convert a CSV file to a custom output format.:
10
11 usage: csvformat [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
12 [-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-S]
13 [--blanks] [-K SKIP_LINES] [-v] [-V] [-D OUT_DELIMITER] [-T]
14 [-Q OUT_QUOTECHAR] [-U {0,1,2,3}] [-B] [-P OUT_ESCAPECHAR]
15 [-M OUT_LINETERMINATOR]
16 [FILE]
17
18 Convert a CSV file to a custom output format.
19
20 positional arguments:
21 FILE The CSV file to operate on. If omitted, will accept
22 input on STDIN.
23
24 optional arguments:
25 -h, --help show this help message and exit
26 -D OUT_DELIMITER, --out-delimiter OUT_DELIMITER
27 Delimiting character of the output CSV file.
28 -T, --out-tabs Specify that the output CSV file is delimited with
29 tabs. Overrides "-D".
30 -Q OUT_QUOTECHAR, --out-quotechar OUT_QUOTECHAR
31 Character used to quote strings in the output CSV
32 file.
33 -U {0,1,2,3}, --out-quoting {0,1,2,3}
34 Quoting style used in the output CSV file. 0 = Quote
35 Minimal, 1 = Quote All, 2 = Quote Non-numeric, 3 =
36 Quote None.
37 -B, --out-no-doublequote
38 Whether or not double quotes are doubled in the output
39 CSV file.
40 -P OUT_ESCAPECHAR, --out-escapechar OUT_ESCAPECHAR
41 Character used to escape the delimiter in the output
42 CSV file if --quoting 3 ("Quote None") is specified
43 and to escape the QUOTECHAR if --no-doublequote is
44 specified.
45 -M OUT_LINETERMINATOR, --out-lineterminator OUT_LINETERMINATOR
46 Character used to terminate lines in the output CSV
47 file.
48
49 See also: ../common_arguments.
50
52 Convert a comma-separated file to a pipe-delimited file:
53
54 csvformat -D "|" examples/dummy.csv
55
56 Convert to carriage return line-endings:
57
58 csvformat -M $'\r' examples/dummy.csv
59
60 To avoid escaping quote characters when using --quoting 3, add
61 --out-quotechar "":
62
63 csvformat -u 3 -U 3 -Q "" examples/optional_quote_characters.csv
64
66 Christopher Groskopf
67
69 2016, Christopher Groskopf
70
71
72
73
741.0.3 Jul 15, 2018 CSVFORMAT(1)