winget install --id=Miller.Miller -e
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON. You get to work with your data using named fields, without needing to count positional column indices. This is something the Unix toolkit always could have done, and arguably always should have done. It operates on key-value-pair data while the familiar Unix tools operate on integer-indexed fields: if the natural data structure for the latter is the array, then Miller’s natural data structure is the insertion-ordered hash map. This encompasses a variety of data formats, including but not limited to the familiar CSV, TSV, and JSON. (Miller can handle positionally-indexed data as a special case.) ## Features - Miller is multi-purpose: it’s useful for data cleaning, data reduction, statistical reporting, devops, system administration, log-file processing, format conversion, and database-query post-processing. - You can use Miller to snarf and munge log-file data, including selecting out relevant substreams, then produce CSV format and load that into all-in-memory/data-frame utilities for further statistical and/or graphical processing. - Miller complements data-analysis tools such as R, pandas, etc.: you can use Miller to clean and prepare your data. While you can do basic statistics entirely in Miller, its streaming-data feature and single-pass algorithms enable you to reduce very large data sets. - Miller complements SQL databases: you can slice, dice, and reformat data on the client side on its way into or out of a database. (Examples here and here). You can also reap some of the benefits of databases for quick, setup-free one-off tasks when you just need to query some data in disk files in a hurry. - Miller also goes beyond the classic Unix tools by stepping fully into our modern, no-SQL world: its essential record-heterogeneity property allows Miller to operate on data where records with different schema (field names) are interleaved. - Miller is streaming: most operations need only a single record in memory at a time, rather than ingesting all input before producing any output. For those operations which require deeper retention (sort, tac, stats1), Miller retains only as much data as needed. This means that whenever functionally possible, you can operate on files which are larger than your system’s available RAM, and you can use Miller in tail -f contexts. - Miller is pipe-friendly and interoperates with the Unix toolkit - Miller’s I/O formats include tabular pretty-printing, positionally indexed (Unix-toolkit style), CSV, JSON, and others - Miller does conversion between formats - Miller’s processing is format-aware: e.g. CSV sort and tac keep header lines first - Miller has high-throughput performance on par with the Unix toolkit - Not unlike jq (for JSON), Miller is written in portable, modern C, with zero runtime dependencies. You can download or compile a single binary, scp it to a faraway machine, and expect it to work.
Miller is a versatile command-line tool designed for processing structured data formats such as CSV, TSV, and JSON using named fields, eliminating the need to track positional indices. Offering multi-purpose capabilities, Miller supports data cleaning, reduction, statistical reporting, log-file processing, and more. Its streaming architecture allows efficient handling of large datasets with minimal memory usage, making it suitable for real-time processing scenarios. With support for various formats including CSV, TSV, JSON, and JSON Lines, Miller ensures seamless data manipulation across different structures. Additionally, its ability to handle record heterogeneity enables processing of data with interleaved schemas, a feature beyond traditional Unix tools. Ideal for developers, system administrators, and data scientists, Miller provides a powerful yet intuitive solution for structured data tasks, enhancing productivity and efficiency in data workflows. It can be installed via winget.
Miller is like awk, sed, cut, join, and sort for data formats such as CSV, TSV, JSON, JSON Lines, and positionally-indexed.
With Miller, you get to use named fields without needing to count positional indices, using familiar formats such as CSV, TSV, JSON, JSON Lines, and positionally-indexed. Then, on the fly, you can add new fields which are functions of existing fields, drop fields, sort, aggregate statistically, pretty-print, and more.
Miller operates on key-value-pair data while the familiar Unix tools operate on integer-indexed fields: if the natural data structure for the latter is the array, then Miller's natural data structure is the insertion-ordered hash map.
Miller handles a variety of data formats, including but not limited to the familiar CSV, TSV, and JSON/JSON Lines. (Miller can handle positionally-indexed data too!)
In the above image you can see how Miller embraces the common themes of key-value-pair data in a variety of data formats.
There's a good chance you can get Miller pre-built for your system:
OS | Installation command |
---|---|
Linux | yum install miller apt-get install miller |
Mac | brew install miller``port install miller |
Windows | choco install miller``winget install Miller.Miller``scoop install main/miller |
See also README-versions.md for a full list of package versions. Note that long-term-support (LtS) releases will likely be on older versions.
See also building from source.
cd /where/you/want/to/put/the/source
git clone https://github.com/johnkerl/miller
cd miller
make
:
make
. This takes just a few seconds and produces the Miller executable, which is ./mlr
(or .\mlr.exe
on Windows).make check
.make install
. This installs the executable /usr/local/bin/mlr
and manual page /usr/local/share/man/man1/mlr.1
(so you can do man mlr
)../configure --prefix=/some/install/path
before make install
if you want to install somewhere other than /usr/local
.make
:
go build github.com/johnkerl/miller/v6/cmd/mlr
.go test github.com/johnkerl/miller/v6/pkg/...
and mlr regtest
.go install github.com/johnkerl/miller/v6/cmd/mlr
will install to GOPATH/bin/mlr
.Miller is multi-purpose: it's useful for data cleaning, data reduction, statistical reporting, devops, system administration, log-file processing, format conversion, and database-query post-processing.
You can use Miller to snarf and munge log-file data, including selecting out relevant substreams, then produce CSV format and load that into all-in-memory/data-frame utilities for further statistical and/or graphical processing.
Miller complements data-analysis tools such as R, pandas, etc.: you can use Miller to clean and prepare your data. While you can do basic statistics entirely in Miller, its streaming-data feature and single-pass algorithms enable you to reduce very large data sets.
Miller complements SQL databases: you can slice, dice, and reformat data on the client side on its way into or out of a database. You can also reap some of the benefits of databases for quick, setup-free one-off tasks when you just need to query some data in disk files in a hurry.
Miller also goes beyond the classic Unix tools by stepping fully into our modern, no-SQL world: its essential record-heterogeneity property allows Miller to operate on data where records with different schema (field names) are interleaved.
Miller is streaming: most operations need only a single record in
memory at a time, rather than ingesting all input before producing any output.
For those operations which require deeper retention (sort
, tac
, stats1
),
Miller retains only as much data as needed. This means that whenever
functionally possible, you can operate on files which are larger than your
system’s available RAM, and you can use Miller in tail -f contexts.
Miller is pipe-friendly and interoperates with the Unix toolkit.
Miller's I/O formats include tabular pretty-printing, positionally indexed (Unix-toolkit style), CSV, TSV, JSON, JSON Lines, and others.
Miller does conversion between formats.
Miller's processing is format-aware: e.g. CSV sort
and tac
keep header lines first.
Miller has high-throughput performance on par with the Unix toolkit.
Miller is written in portable, modern Go, with zero runtime dependencies.
You can download or compile a single binary, scp
it to a faraway machine,
and expect it to work.
Today I discovered Miller—it's like jq but for CSV: https://t.co/pn5Ni241KMAlso, "Miller complements data-analysis tools such as R, pandas, etc.: you can use Miller to clean and prepare your data." @GreatBlueC @nfmcclure
Underappreciated swiss-army command-line chainsaw."Miller is like awk, sed, cut, join, and sort for [...] CSV, TSV, and [...] JSON." https://t.co/TrQqSUK3KK
Miller looks like a great command line tool for working with CSV data. Sed, awk, cut, join all rolled into one: http://t.co/9BBb6VCZ6Y
Miller is like sed, awk, cut, join, and sort for name-indexed data such as CSV: http://t.co/1zPbfg6B2W - handy tool!
Btw, I think Miller is the best CLI tool to deal with CSV. I used to use this when I need to preprocess too big CSVs to load into R (now we have vroom, so such cases might be rare, though...)https://t.co/kUjrSSGJoT
Miller: a *format-aware* data munging tool By @__jo_ker__ to overcome limitations with *line-aware* workshorses like awk, sed et al https://t.co/LCyPkhYvt9The project website is a fantastic example of good software documentation!!
Holy holly data swiss army knife batman! How did no one suggest Miller https://t.co/JGQpmRAZLv for solving database cleaning / ETL issues to me before Congrats to @__jo_ker__ for amazingly intuitive tool for critical data management tasks!#DataScienceandLaw #ComputationalLaw
🤯@__jo_ker__'s Miller easily reads, transforms, + writes all sorts of tabular data. It's standalone, fast, and built for streaming data (operating on one line at a time, so you can work on files larger than memory).And the docs are dream. I've been reading them all morning! https://t.co/Be2pGPZK6t
Thanks to all the fine people who help make Miller better (emoji key):
<a href="https://github.com/aborruso"><img src="https://avatars.githubusercontent.com/u/30607?v=4?s=50" width="50px;" /><b>Andrea Borruso</b></a><a href="#ideas-aborruso">🤔</a> <a href="#design-aborruso">🎨</a>
<a href="https://sjackman.ca/"><img src="https://avatars.githubusercontent.com/u/291551?v=4?s=50" width="50px;" /><b>Shaun Jackman</b></a><a href="#ideas-sjackman">🤔</a>
<a href="http://www.fredtrotter.com/"><img src="https://avatars.githubusercontent.com/u/83133?v=4?s=50" width="50px;" /><b>Fred Trotter</b></a><a href="#ideas-ftrotter">🤔</a> <a href="#design-ftrotter">🎨</a>
<a href="https://github.com/Komosa"><img src="https://avatars.githubusercontent.com/u/10688154?v=4?s=50" width="50px;" /><b>komosa</b></a><a href="#ideas-Komosa">🤔</a>
<a href="https://github.com/jungle-boogie"><img src="https://avatars.githubusercontent.com/u/1111743?v=4?s=50" width="50px;" /><b>jungle-boogie</b></a><a href="#ideas-jungle-boogie">🤔</a>
<a href="https://github.com/0-wiz-0"><img src="https://avatars.githubusercontent.com/u/2221844?v=4?s=50" width="50px;" /><b>Thomas Klausner</b></a><a href="#infra-0-wiz-0">🚇</a>
<a href="https://github.com/skitt"><img src="https://avatars.githubusercontent.com/u/2128935?v=4?s=50" width="50px;" /><b>Stephen Kitt</b></a><a href="#platform-skitt">📦</a>
<a href="http://leahneukirchen.org/"><img src="https://avatars.githubusercontent.com/u/139?v=4?s=50" width="50px;" /><b>Leah Neukirchen</b></a><a href="#ideas-leahneukirchen">🤔</a>
<a href="https://github.com/lgbaldoni"><img src="https://avatars.githubusercontent.com/u/1450716?v=4?s=50" width="50px;" /><b>Luigi Baldoni</b></a><a href="#platform-lgbaldoni">📦</a>
<a href="https://yutani.rbind.io/"><img src="https://avatars.githubusercontent.com/u/1978793?v=4?s=50" width="50px;" /><b>Hiroaki Yutani</b></a><a href="#ideas-yutannihilation">🤔</a>
<a href="https://3e.org/"><img src="https://avatars.githubusercontent.com/u/41439?v=4?s=50" width="50px;" /><b>Daniel M. Drucker</b></a><a href="#ideas-dmd">🤔</a>
<a href="https://github.com/NikosAlexandris"><img src="https://avatars.githubusercontent.com/u/7046639?v=4?s=50" width="50px;" /><b>Nikos Alexandris</b></a><a href="#ideas-NikosAlexandris">🤔</a>
<a href="https://github.com/kundeng"><img src="https://avatars.githubusercontent.com/u/89032?v=4?s=50" width="50px;" /><b>kundeng</b></a><a href="#platform-kundeng">📦</a>
<a href="http://victorsergienko.com/"><img src="https://avatars.githubusercontent.com/u/151199?v=4?s=50" width="50px;" /><b>Victor Sergienko</b></a><a href="#platform-singalen">📦</a>
<a href="https://github.com/gromgit"><img src="https://avatars.githubusercontent.com/u/215702?v=4?s=50" width="50px;" /><b>Adrian Ho</b></a><a href="#design-gromgit">🎨</a>
<a href="https://github.com/Zachp"><img src="https://avatars.githubusercontent.com/u/1316442?v=4?s=50" width="50px;" /><b>zachp</b></a><a href="#platform-Zachp">📦</a>
<a href="https://dsel.net/"><img src="https://avatars.githubusercontent.com/u/921669?v=4?s=50" width="50px;" /><b>David Selassie</b></a><a href="#ideas-davidselassie">🤔</a>
<a href="http://www.joelparkerhenderson.com/"><img src="https://avatars.githubusercontent.com/u/27145?v=4?s=50" width="50px;" /><b>Joel Parker Henderson</b></a><a href="#ideas-joelparkerhenderson">🤔</a>
<a href="https://github.com/divtiply"><img src="https://avatars.githubusercontent.com/u/5359679?v=4?s=50" width="50px;" /><b>Michel Ace</b></a><a href="#ideas-divtiply">🤔</a>
<a href="http://fuco1.github.io/sitemap.html"><img src="https://avatars.githubusercontent.com/u/2664959?v=4?s=50" width="50px;" /><b>Matus Goljer</b></a><a href="#ideas-Fuco1">🤔</a>
<a href="https://github.com/terorie"><img src="https://avatars.githubusercontent.com/u/21371810?v=4?s=50" width="50px;" /><b>Richard Patel</b></a><a href="#platform-terorie">📦</a>
<a href="https://blog.kub1x.org/"><img src="https://avatars.githubusercontent.com/u/1833840?v=4?s=50" width="50px;" /><b>Jakub Podlaha</b></a><a href="#design-kub1x">🎨</a>
<a href="https://goo.gl/ZGZynx"><img src="https://avatars.githubusercontent.com/u/85767?v=4?s=50" width="50px;" /><b>Miodrag Milić</b></a><a href="#platform-majkinetor">📦</a>
<a href="https://github.com/derekmahar"><img src="https://avatars.githubusercontent.com/u/6047?v=4?s=50" width="50px;" /><b>Derek Mahar</b></a><a href="#ideas-derekmahar">🤔</a>
<a href="https://github.com/spmundi"><img src="https://avatars.githubusercontent.com/u/38196185?v=4?s=50" width="50px;" /><b>spmundi</b></a><a href="#ideas-spmundi">🤔</a>
<a href="https://github.com/koernepr"><img src="https://avatars.githubusercontent.com/u/24551942?v=4?s=50" width="50px;" /><b>Peter Körner</b></a><a href="#security-koernepr">🛡️</a>
<a href="https://github.com/rubyFeedback"><img src="https://avatars.githubusercontent.com/u/46686565?v=4?s=50" width="50px;" /><b>rubyFeedback</b></a><a href="#ideas-rubyFeedback">🤔</a>
<a href="https://github.com/rbolsius"><img src="https://avatars.githubusercontent.com/u/2106964?v=4?s=50" width="50px;" /><b>rbolsius</b></a><a href="#platform-rbolsius">📦</a>
<a href="https://github.com/awildturtok"><img src="https://avatars.githubusercontent.com/u/1553491?v=4?s=50" width="50px;" /><b>awildturtok</b></a><a href="#ideas-awildturtok">🤔</a>
<a href="https://github.com/agguser"><img src="https://avatars.githubusercontent.com/u/1206106?v=4?s=50" width="50px;" /><b>agguser</b></a><a href="#ideas-agguser">🤔</a>
<a href="https://github.com/jganong"><img src="https://avatars.githubusercontent.com/u/2783890?v=4?s=50" width="50px;" /><b>jganong</b></a><a href="#ideas-jganong">🤔</a>
<a href="https://www.linkedin.com/in/fulvio-scapin"><img src="https://avatars.githubusercontent.com/u/69568?v=4?s=50" width="50px;" /><b>Fulvio Scapin</b></a><a href="#ideas-trantor">🤔</a>
<a href="https://github.com/torbiak"><img src="https://avatars.githubusercontent.com/u/109347?v=4?s=50" width="50px;" /><b>Jordan Torbiak</b></a><a href="#ideas-torbiak">🤔</a>
<a href="https://github.com/Andy1978"><img src="https://avatars.githubusercontent.com/u/240064?v=4?s=50" width="50px;" /><b>Andreas Weber</b></a><a href="#ideas-Andy1978">🤔</a>
<a href="https://github.com/vapniks"><img src="https://avatars.githubusercontent.com/u/174330?v=4?s=50" width="50px;" /><b>vapniks</b></a><a href="#platform-vapniks">📦</a>
<a href="https://github.com/89z"><img src="https://avatars.githubusercontent.com/u/73562167?v=4?s=50" width="50px;" /><b>Zombo</b></a><a href="#platform-89z">📦</a>
<a href="https://github.com/BEFH"><img src="https://avatars.githubusercontent.com/u/3386600?v=4?s=50" width="50px;" /><b>Brian Fulton-Howard</b></a><a href="#platform-BEFH">📦</a>
<a href="https://github.com/ChCyrill"><img src="https://avatars.githubusercontent.com/u/2165604?v=4?s=50" width="50px;" /><b>ChCyrill</b></a><a href="#ideas-ChCyrill">🤔</a>
<a href="https://github.com/jauderho"><img src="https://avatars.githubusercontent.com/u/13562?v=4?s=50" width="50px;" /><b>Jauder Ho</b></a><a href="https://github.com/johnkerl/miller/commits?author=jauderho">💻</a>
<a href="https://github.com/psacawa"><img src="https://avatars.githubusercontent.com/u/21274063?v=4?s=50" width="50px;" /><b>Paweł Sacawa</b></a><a href="https://github.com/johnkerl/miller/issues?q=author%3Apsacawa">🐛</a>
<a href="https://github.com/schragge"><img src="https://avatars.githubusercontent.com/u/4294278?v=4?s=50" width="50px;" /><b>schragge</b></a><a href="https://github.com/johnkerl/miller/commits?author=schragge">📖</a>
<a href="https://github.com/Poshi"><img src="https://avatars.githubusercontent.com/u/1780510?v=4?s=50" width="50px;" /><b>Jordi</b></a><a href="https://github.com/johnkerl/miller/commits?author=Poshi">📖</a> <a href="#ideas-Poshi">🤔</a>
This project follows the all-contributors specification. Contributions of any kind are welcome!