Recipes
1. Inspect the first twenty rows
Task: display a compact preview of a TSV file with named columns.
tsvpeek --header --table --limit 20 data.tsvid name state
--- -------- -----
1 alpha ready
2 beta wait
...2. Select three named columns
tsvpeek --header --columns id,name,state data.tsv1 alpha ready
2 beta wait3. Keep rows with one exact value
tsvpeek --header --where 'state=ready' data.tsv1 alpha ready 1040
3 gamma ready 20484. Apply two conditions
tsvpeek \
--header \
--where 'state=ready' \
--where 'bytes:num>=1000' \
data.tsv1 alpha ready 1040
3 gamma ready 20485. Search for text inside a field
tsvpeek --header --where 'name~cache' data.tsv41 cache-main ready 600
57 cache-old disabled 1206. Count matching rows
tsvpeek --header --where 'state=ready' --count data.tsv184277. Read CSV and emit TSV
tsvpeek --csv --output-delimiter '\t' input.csv1 alpha ready
2 beta wait8. Sort a small filtered result
tsvpeek \
--header \
--where 'state=ready' \
--sort bytes:num:desc \
--limit 10 \
data.tsv91 archive-a ready 983040
44 part-17 ready 540100
18 block-2 ready 1044009. Remove duplicate keys
tsvpeek --header --unique id data.tsv1 alpha ready
2 beta wait
3 gamma ready10. Find malformed rows
tsvpeek --expected-fields 4 --line-number data.tsvWith normal diagnostic output, records whose field count differs from four are reported with their source line number.
11. Ignore malformed records
tsvpeek \
--expected-fields 4 \
--skip-bad \
data.tsv1 alpha ready 1040
3 gamma ready 204812. Process compressed input from another command
gzip -dc data.tsv.gz |
tsvpeek --header --columns name,state --limit 25alpha ready
beta wait
gamma ready