# miller

> Command-line data processing tool for CSV, TSV, JSON, and JSON Lines with field-based operations

Stars: 10.1k · Language: Go · License: BSD-2-Clause · Categories: Data

- Repository: https://github.com/johnkerl/miller
- Website: https://miller.readthedocs.io
- Page: https://www.trmn.sh/tools/miller

## Install

- Homebrew: `brew install miller`
- APT: `apt-get install miller`
- Go: `go install github.com/johnkerl/miller/v6/cmd/mlr@latest`

## Overview

Miller is a command-line data processing tool that operates on structured data formats including CSV, TSV, JSON, JSON Lines, and positionally-indexed data. It functions like traditional Unix tools (awk, sed, cut, join, sort) but works with named fields rather than positional indices, making it suitable for modern data formats where field names matter.

The tool supports field manipulation operations such as adding computed fields, dropping columns, sorting, statistical aggregation, and format conversion. Miller handles heterogeneous records where different rows can have different schemas, which is common in NoSQL and log data. It processes data in a streaming fashion, keeping only one record in memory at a time for most operations, enabling it to work with datasets larger than available RAM.

Miller targets data analysts, DevOps engineers, and system administrators who need to clean, transform, or analyze structured data from the command line. It complements data analysis tools like R and pandas by preprocessing data before loading into memory-intensive frameworks. The tool integrates with Unix pipelines and supports format-aware operations like keeping CSV headers when sorting.

### Installation

```bash
# via Homebrew
brew install miller
```

```bash
# via APT
apt-get install miller
```

```bash
# via Go
go install github.com/johnkerl/miller/v6/cmd/mlr@latest
```

![Miller data formats overview](https://media.trmn.sh/cached/a4a2c7d6904aa4048cc8fd1cdbfb6c2128e92f88aa46fede3f9cf81c79ac17d5.png)

## Alternatives

- [usql](https://www.trmn.sh/tools/usql.md): Universal command-line SQL client with PostgreSQL psql-inspired interface for multiple databases (Go, 10.2k stars)
- [pup](https://www.trmn.sh/tools/pup.md): Command line HTML processing tool using CSS selectors to filter and extract data from HTML documents (Go, 8.4k stars)
- [dasel](https://www.trmn.sh/tools/dasel.md): Command-line tool for querying, modifying, and transforming structured data files (JSON, YAML, TOML, XML, CSV) (Go, 8.1k stars)
- [jid](https://www.trmn.sh/tools/jid.md): Interactive JSON explorer that takes piped input and lets you drill down with dot-path or JMESPath queries, with tab completion and suggestions. (Go, 7.2k stars)
- [gron](https://www.trmn.sh/tools/gron.md): Transforms JSON into discrete assignments to make it greppable and enable exploration of complex JSON structures (Go, 14.5k stars)

## Guides

- [Filter and summarize a CSV with Miller](https://www.trmn.sh/guides/miller-csv-summary): Use Miller to handle a quoted comma, select rows, and sum numeric fields by group in a CSV file.
- [Best CSV Tools for the Command Line](https://www.trmn.sh/best/csv-tools): Compare Miller, VisiData, xsv, qo and csvlens for querying, transforming and browsing CSV files from the terminal.

---

Canonical: https://www.trmn.sh/tools/miller
