Miller 5.9.0

Overview   Using   Reference   Background   Repository  

FAQ
Customization: .mlrrc
Mixing with other languages
Cookbook part 1
Cookbook part 2
Cookbook part 3
Data-diving examples

Customization: .mlrrc
• How to use .mlrrc
• What you can put in your .mlrrc
• Where to put your .mlrrc

How to use .mlrrc

Suppose you always use CSV files. Then instead of always having to type --csv as in

mlr --csv cut -x -f extra mydata.csv

mlr --csv sort -n id mydata.csv

and so on, you can instead put the following into your $HOME/.mlrrc:

--csv

Then you can just type things like

mlr cut -x -f extra mydata.csv

mlr sort -n id mydata.csv

and the --csv part will automatically be understood. (If you do want to process, say, a JSON file then mlr --json ... at the command line will override the default from your .mlrrc.)

What you can put in your .mlrrc

Here is an example .mlrrc file:

# These are my preferred default settings for Miller

# Input and output formats are CSV by default (unless otherwise specified
# on the mlr command line):
csv

# If a data line has fewer fields than the header line, instead of erroring
# (which is the default), just insert empty values for the missing ones:
allow-ragged-csv-input

# These are no-ops for CSV, but when I do use JSON output, I want these
# pretty-printing options to be used:
jvstack
jlistwrap

# Use "@", rather than "#", for comments within data files:
skip-comments-with @

Where to put your .mlrrc