Process structured text files with Miller
One by One

© Lead Image © bahri altay, 123RF.com
Miller offers a clever alternative for working with structured text files: use a single tool to replace the strings of commands built from conventional utilities like grep, cut, and sed.
Miller [1] is a helpful command-line tool for working with structured files. Instead of contending with long instructions lined with pipes, you can achieve your goals with more compact constructs.
Miller supports a variety of formats (Table 1), which it lists when called with mlr --usage-data-format-examples
. We used version 3.1.2 for this article, freshly compiled from the sources.
Miller is a single utility that lets you combine the effects of several classic Unix tools, like grep, cut, join, sort, tail, head, and sed. The syntax of mlr
uses commands with their own options. Table 2 shows a selection of commands for mlr
. See the box called "Some Examples" for examples of mlr
commands.
[...]
Buy this article as PDF
(incl. VAT)