Work With CSV and JSON Using Miller

Filter, transform and convert tabular data with a single tool.

macOStextstatsjsoncsvLow risk
Run printf 'a,b\n1,2\n' | mlr --icsv --ojson cat to convert CSV to JSON.

01Command

Command
$ printf 'a,b\n1,2\n' | mlr --icsv --ojson cat

02What it does

Miller treats CSV, TSV, JSON and other formats as streams of records with named fields, offering verbs such as cut, filter, sort, stats1 and join. Format flags let you mix input and output formats freely, which is why it is nicknamed the 'awk for names data'.

03Risk

RiskLow risk
CompatibilitymacOS with Homebrew installed
!Warning: Field names with special characters or whitespace may need quoting in expressions; test on a sample first.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Homebrew formula: miller
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Like sed, awk, cut, join & sort for name-indexed data such as CSV. Packages Miller (mlr), a tool for manipulating CSV, TSV and JSON records.

Last verified: 2026-09-22 · Category: Developer

06Related solutions