csvlook1
Csvlook documentation
Overview
Renders a CSV to the command line in a Markdown-compatible, fixed-width format:
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 acceptinput 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 beforetruncating the data.--max-columns MAX_COLUMNSThe maximum number of columns to display beforetruncating the data.--max-column-width MAX_COLUMN_WIDTHTruncate all columns to at most this width. Theremainder will be replaced with ellipsis.--max-precision MAX_PRECISIONThe maximum number of decimal places to display. Theremainder will be replaced with ellipsis.--no-number-ellipsis Disable the ellipsis if --max-precision is exceeded.-y SNIFF_LIMIT, --snifflimit SNIFF_LIMITLimit CSV dialect sniffing to the specified number ofbytes. 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 parsingthe input.
If a table is too wide to display properly 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 piping 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-inference along with --max-column-width.
Examples
Basic use:
csvlook examples/testfixed_converted.csv
This tool is especially useful as a final operation when piping through other tools:
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.
To ignore the extra cells, instead:
csvcut -C "" examples/bad.csv | csvlook
If these rows are at the top of the file (for example, copyright notices), you can skip the rows:
csvlook --skip-lines 1 examples/bad.csv
This error can also occur 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.
History
- Arch Linux 2026-11-01: the text shown here
- Debian 13 (Trixie)
- Debian 12 (Bookworm)
- Debian 11 (Bullseye)
--blanks until Debian 12 (Bookworm);
--date-format until Debian 12 (Bookworm);
--datetime-format until Debian 12 (Bookworm);
--delimiter until Debian 12 (Bookworm);
--encoding until Debian 12 (Bookworm);
--escapechar until Debian 12 (Bookworm);
--help until Debian 12 (Bookworm);
--linenumbers until Debian 12 (Bookworm);
--locale until Debian 12 (Bookworm);
--max-column-width until Debian 12 (Bookworm);
--max-columns until Debian 12 (Bookworm);
--max-rows until Debian 12 (Bookworm);
--maxfieldsize until Debian 12 (Bookworm);
--no-doublequote until Debian 12 (Bookworm);
--no-header-row until Debian 12 (Bookworm);
--no-inference until Debian 12 (Bookworm);
--quotechar until Debian 12 (Bookworm);
--quoting until Debian 12 (Bookworm);
--skip-lines until Debian 12 (Bookworm);
--skipinitialspace until Debian 12 (Bookworm);
--snifflimit until Debian 12 (Bookworm);
--tabs until Debian 12 (Bookworm);
--verbose until Debian 12 (Bookworm);
--version until Debian 12 (Bookworm);
--zero until Debian 12 (Bookworm);
-H until Debian 12 (Bookworm);
-I until Debian 12 (Bookworm);
-K until Debian 12 (Bookworm);
-L until Debian 12 (Bookworm);
-S until Debian 12 (Bookworm);
-V until Debian 12 (Bookworm);
-b until Debian 12 (Bookworm);
-d until Debian 12 (Bookworm);
-e until Debian 12 (Bookworm);
-h until Debian 12 (Bookworm);
-l until Debian 12 (Bookworm);
-p until Debian 12 (Bookworm);
-q until Debian 12 (Bookworm);
-t until Debian 12 (Bookworm);
-u until Debian 12 (Bookworm);
-v until Debian 12 (Bookworm);
-y until Debian 12 (Bookworm);
-z until Debian 12 (Bookworm).