2016-01-21 23:03:08 +00:00
|
|
|
# csvformat
|
|
|
|
|
|
|
|
> Convert a CSV file to a custom output format.
|
|
|
|
> Included in csvkit.
|
2019-06-09 00:05:31 +01:00
|
|
|
> More information: <https://csvkit.readthedocs.io/en/latest/scripts/csvformat.html>.
|
2016-01-21 23:03:08 +00:00
|
|
|
|
2016-01-28 20:08:47 +00:00
|
|
|
- Convert to a tab-delimited file (TSV):
|
2016-01-21 23:03:08 +00:00
|
|
|
|
|
|
|
`csvformat -T {{data.csv}}`
|
|
|
|
|
|
|
|
- Convert delimiters to a custom character:
|
|
|
|
|
|
|
|
`csvformat -D "{{custom_character}}" {{data.csv}}`
|
|
|
|
|
2016-01-28 20:08:47 +00:00
|
|
|
- Convert line endings to carriage return (^M) + line feed:
|
2016-01-21 23:03:08 +00:00
|
|
|
|
|
|
|
`csvformat -M "{{\r\n}}" {{data.csv}}`
|
|
|
|
|
2016-01-28 20:08:47 +00:00
|
|
|
- Minimize use of quote characters:
|
2016-01-21 23:03:08 +00:00
|
|
|
|
|
|
|
`csvformat -U 0 {{data.csv}}`
|
|
|
|
|
2016-01-28 20:08:47 +00:00
|
|
|
- Maximize use of quote characters:
|
2016-01-21 23:03:08 +00:00
|
|
|
|
|
|
|
`csvformat -U 1 {{data.csv}}`
|