Sample output
date region product units revenue
2026-01-15 northeast widget-a 150 4500.00
2026-01-15 southwest widget-b 89 2670.00
2026-02-01 northeast widget-a 200 6000.00
2026-02-01 midwest widget-c 45 2250.00
2026-03-10 southwest widget-a 175 5250.00
2026-03-10 northeast widget-b 120 3600.00
2026-04-22 midwest widget-a 95 2850.00
2026-04-22 southwest widget-c 60 3000.00
Every column is as wide as its longest cell plus two spaces, so you can read down revenue without counting commas. The header row gets no special treatment. It lines up because it happens to be the first row.
When you would reach for it
A CSV export you want to eyeball before you decide what to do with it, a TSV from a database dump, or any command whose output is ragged because its fields vary in length. Pipe it into column -t and the structure becomes visible. It is also the last step in a lot of pipelines: sort, awk, or cut does the work, and column makes the result legible.
Gotchas
- On macOS the BSD
columncollapses adjacent delimiters, so a row like2026-05-01,,widget-aloses its empty cell and every field after it shifts one column left. The util-linuxcolumnon Debian keeps empty cells in place. On a Mac, fill the gaps first:sed -e 's/,,/, ,/g; s/,,/, ,/g' file.csv | column -s, -t. The substitution runs twice because each match consumes the comma that the next empty field would need. -stakes a set of characters, not a multi-character separator.-s ', 'splits on commas and on spaces, which shreds any cell that contains a space.columnknows nothing about CSV quoting. A cell like"Portland, OR"splits at the comma into two cells. For real CSV with quoted fields, usemlr --icsv --opprint cat file.csv.- Without
-s, the delimiter is any run of whitespace. That suits TSV files and command output, but a cell likeAda Lovelacebecomes two cells. On slim Debian imagescolumnmay be missing entirely: installbsdextrautils.
Variants
$ (head -1 sales.csv; tail -n +2 sales.csv | sort -t, -k5 -nr) | column -s, -t
Sort by revenue and keep the header on top. The parentheses run both commands in one subshell, so their output reaches column as a single stream
$ column -s, -t -R 4,5 sales.csv
Linux only. Right-aligns the numeric columns so the digits line up by place value
$ column -s, -t -J -n sales -N date,region,product,units,revenue <(tail -n +2 sales.csv)
Linux only. Turns the CSV into JSON, with every value as a string. -N names the columns, and the process substitution feeds in the file without its header row