Miller Try It
Like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
Version
Latest known: 6.18.1 (2026-04-22)
Latest known: 6.18.1 (2026-04-22)
Examples
1. Used to sanitize MLS TSV file. Some agent got clever and entered ZIP+4 and it caused a problem with our auomated bulk import process.
mlr.exe --itsv --otsv put '$PostalCode = substr($PostalCode, 0,4)' d:\MLS-ZipPlus4.txt >d:\MLS-clean.txt
Try it
- Convert iris.csv to JSON
Miller's verb chain is read-format / verb / write-format. --icsv tells Miller the input is CSV; --ojson sets the output to JSON. The 'cat' verb passes every row through unchanged, which combined with the format swap means a clean CSV-to-JSON transformation with no field reshaping. Output is JSON Lines (one record per line); tryit.cfm pretty-prints it centrally. - Filter iris.csv to a single species
The 'filter' verb runs a Miller DSL expression against every record and keeps only those that evaluate truthy. The expression $species == "setosa" (loaded from a sibling .mlr file via 'filter -f ...') selects iris-setosa rows by named field. Output is CSV with the same column shape as the input. The file-based approach is used because Miller's DSL requires double-quoted string literals AND Java's ProcessBuilder on Windows mangles embedded double quotes in argv; loading the expression from a file sidesteps shell quoting entirely (same trick as the JQ CSV demo). - Per-species aggregate stats
Use stats1 to compute one-pass summary statistics. -a mean,stddev,min,max picks the accumulators; -f sepal_length,petal_length picks the value columns; -g species groups the rows so the output has one summary record per distinct species. The chained --icsv --ojson reads CSV in and writes JSON out so the grouped breakdown is easy to scan.
Agree to terms to run demos.