CSVLOOK(1)
β¨ csvlook π
okay so bestie, this is csvlook β part of the csvkit crew β and it's literally the glow-up your boring CSV file has been waiting for. no cap.
πΈ NAME πΈ
csvlook β the csvkit tool that makes your CSV look cute on the command line. this is its documentation, periodt.
π DESCRIPTION π
It renders a CSV to the command line in a Markdown-compatible, fixed-width format. like, your spreadsheet but it ate and left no crumbs.
usage: csvlook [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
[-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-L LOCALE]
[-S] [--blanks] [--null-value NULL_VALUES [NULL_VALUES ...]]
[--date-format DATE_FORMAT] [--datetime-format DATETIME_FORMAT]
[-H] [-K SKIP_LINES] [-v] [-l] [--zero] [-V]
[--max-rows MAX_ROWS] [--max-columns MAX_COLUMNS]
[--max-column-width MAX_COLUMN_WIDTH]
[--max-precision MAX_PRECISION] [--no-number-ellipsis]
[-y SNIFF_LIMIT] [-I]
[FILE]
Render a CSV file in the console as a Markdown-compatible, fixed-width table.
positional arguments:
FILE The CSV file to operate on. If omitted, will accept
input as piped data via STDIN.
optional arguments:
-h, --help show this help message and exit
--max-rows MAX_ROWS The maximum number of rows to display before
truncating the data.
--max-columns MAX_COLUMNS
The maximum number of columns to display before
truncating the data.
--max-column-width MAX_COLUMN_WIDTH
Truncate all columns to at most this width. The
remainder will be replaced with ellipsis.
--max-precision MAX_PRECISION
The maximum number of decimal places to display. The
remainder will be replaced with ellipsis.
--no-number-ellipsis Disable the ellipsis if --max-precision is exceeded.
-y SNIFF_LIMIT, --snifflimit SNIFF_LIMIT
Limit CSV dialect sniffing to the specified number of
bytes. Specify "0" to disable sniffing entirely, or
"-1" to sniff the entire file.
-I, --no-inference Disable type inference (and --locale, --date-format,
--datetime-format, --no-leading-zeroes) when parsing
the input.
okay now let's talk about the ~situation~ π
π₯ the vibes, explained
FILEβ the CSV file you want it to operate on. if you don't give it one, it'll just accept input as piped data viaSTDIN. she's flexible like that π«Ά-h,--helpβ shows this help message and dips. iconic behaviour.--max-rows MAX_ROWSβ the max number of rows to display before it starts truncating the data. too long, didn't read, literally.--max-columns MAX_COLUMNSβ same energy but for columns: the max number of columns to display before truncating the data.--max-column-width MAX_COLUMN_WIDTHβ truncates all columns to at most this width. whatever's left over gets replaced with an ellipsis. she's editing. βοΈ--max-precision MAX_PRECISIONβ the max number of decimal places to display. the remainder gets replaced with ellipsis.--no-number-ellipsisβ turns off the ellipsis if--max-precisiongets exceeded. no dots for you.-y SNIFF_LIMIT,--snifflimit SNIFF_LIMITβ limits CSV dialect sniffing to the specified number of bytes. set it to"0"to disable sniffing entirely, or"-1"to sniff the entire file. she's thorough π-I,--no-inferenceβ disables type inference (and--locale,--date-format,--datetime-format,--no-leading-zeroes) when parsing the input.
if a table is too wide to display properly, bestie, try piping the output to less -S or truncating it using csvcut.
if the table is too long? try filtering it down with grep, or pipe the output to less.
See also: Arguments common to all tools.
NOTE: the fractional part of a decimal numberal is always truncated. to control this truncation, use--no-inferencealong with--max-column-width.
π EXAMPLES π
basic use, the classic, the blueprint:
csvlook examples/testfixed_converted.csv
this tool is especially useful as a final operation when you're piping through other tools. the way that she closes out the pipelineβ¦ π
csvcut -c 9,1 examples/realdata/FY09_EDU_Recipients_by_State.csv | csvlook
if a data row contains more cells than the header row, csvlook will error. use csvclean to remove such rows. (not the vibe, but okay.)
to ignore the extra cells instead:
csvcut -C "" examples/bad.csv | csvlook
if those rows are at the top of the file (like, copyright notices, very boring), you can skip the rows:
csvlook --skip-lines 1 examples/bad.csv
this error can also happen if csvlook incorrectly deduces ("sniffs") the CSV format π. to disable CSV sniffing, set --snifflimit 0 and then, if necessary, set the --delimiter and --quotechar options yourself. or, set --snifflimit -1 to use the entire file as the sample, instead of the first 1024 bytes.
π¦ AUTHOR π¦
Christopher Groskopf and contributors π (legends, honestly)
π COPYRIGHT π
2016, Christopher Groskopf and James McKinney
and that's the whole page, bestie β written by the csvkit girlies, version 2.2.0, dated Aug 16, 2024. slay, 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