csv — skill0
Process CSV data: view, filter, convert, merge. Works with any tabular data source.
Quick Start
# With x-cmd
x csv tab 1,3,6 < data.csv # Show specific columns
x csv awk '{print $1, $3}' < data.csv # Process with AWK
x csv tojson < data.csv # Convert to JSON
x csv merge2 id file2.csv < file1.csv # Merge by key
# Without x-cmd — use Python
python3 -c "
import csv, json, sys
reader = csv.DictReader(sys.stdin)
for row in reader:
print(row['name'], row['value'])
" < data.csv
# Or use Miller (mlr), xsv, csvkit
What's Available
x csv tab <cols>— Display selected columnsx csv awk '{...}'— AWK-style processingx csv tojson— Convert to JSONx csv tojsonl— Convert to JSON Linesx csv totsv— Convert to TSVx csv merge2— Merge two CSVs by keyx csv header— Operate on headersx csv app— Interactive table viewer
Standalone Alternatives
- Python:
csvmodule,pandas - CLI:
mlr(Miller),xsv,csvcut,csvgrep - AWK:
awk -F, '{print $1}'
This skill0 grows
Starting with the essentials. Will add:
- Common CSV patterns
- Python/awk recipes
- Data cleaning tips
Related
- tsv — sibling columnar-format tool (TSV)