Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aborruso
Last active December 24, 2022 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aborruso/bb70a6cf4e49ff6f19e28df870ed7821 to your computer and use it in GitHub Desktop.
Save aborruso/bb70a6cf4e49ff6f19e28df870ed7821 to your computer and use it in GitHub Desktop.

When it encounters data files with different category columns, miller is able to manage record heterogeneity.

For example, we’ll create two other files with differing columns:

$ cat A4.csv
A,B
1,2
$ cat C4.csv
A,B,C
7,9,2

Next, we merge them using unsparsify verb, that prints records with the union of field names over all input records:

$ mlr --csv unsparsify A4.csv C4.csv > out4.csv
$ cat out4.csv
A,B,C
1,2,
7,9,2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment