From 07790cac3ee288f93633c5575f3a36744dff7b91 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Wed, 19 Aug 2020 10:37:01 -0400 Subject: [PATCH] mlrrc doc --- doc/content-for-customization.html | 95 ++++++ doc/cookbook.html | 115 +++---- doc/cookbook2.html | 11 +- doc/cookbook3.html | 1 + doc/customization.html | 233 +++++++++++++ doc/data-examples.html | 1 + doc/data-sharing.html | 1 + doc/faq.html | 37 +- doc/file-formats.html | 10 +- doc/poki-cfg.json | 4 + doc/record-heterogeneity.html | 14 +- doc/reference-dsl.html | 532 ++++++++++++++--------------- doc/reference-verbs.html | 370 ++++++++++---------- doc/reference.html | 82 ++--- doc/sample_mlrrc | 17 + 15 files changed, 939 insertions(+), 584 deletions(-) create mode 100644 doc/content-for-customization.html create mode 100644 doc/customization.html create mode 100644 doc/sample_mlrrc diff --git a/doc/content-for-customization.html b/doc/content-for-customization.html new file mode 100644 index 000000000..92714dfac --- /dev/null +++ b/doc/content-for-customization.html @@ -0,0 +1,95 @@ +POKI_PUT_TOC_HERE + +

+ + + +

How to use .mlrrc

+ +
+ +

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

+ +POKI_CARDIFY(mlr --csv cut -x -f extra mydata.csv)HERE + +POKI_CARDIFY(mlr --csv sort -n id mydata.csv)HERE + +

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

+ +POKI_CARDIFY(--csv)HERE + +

Then you can just type things like

+ +POKI_CARDIFY(mlr cut -x -f extra mydata.csv)HERE + +POKI_CARDIFY(mlr sort -n id mydata.csv)HERE + +

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: + +POKI_INCLUDE_ESCAPED(sample_mlrrc)HERE + +

+ +

Where to put your .mlrrc

+ +
+ + + +
diff --git a/doc/cookbook.html b/doc/cookbook.html index 993025b66..9735a9ae9 100644 --- a/doc/cookbook.html +++ b/doc/cookbook.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 @@ -419,11 +420,11 @@ $ mlr put ' "x": $y, }; ' data/small -{ "z": 0.346790, "KEYFIELD": "pan", "i": 1, "b": "pan", "y": 0.346790, "x": 0.726803 } -{ "z": 0.758680, "KEYFIELD": "eks", "i": 3, "b": "pan", "y": 0.758680, "x": 0.522151 } -{ "z": 0.204603, "KEYFIELD": "wye", "i": 6, "b": "wye", "y": 0.204603, "x": 0.338319 } -{ "z": 0.381399, "KEYFIELD": "eks", "i": 10, "b": "wye", "y": 0.381399, "x": 0.134189 } -{ "z": 0.573289, "KEYFIELD": "wye", "i": 15, "b": "pan", "y": 0.573289, "x": 0.863624 } +z=0.346790,KEYFIELD=pan,i=1,b=pan,y=0.346790,x=0.726803 +z=0.758680,KEYFIELD=eks,i=3,b=pan,y=0.758680,x=0.522151 +z=0.204603,KEYFIELD=wye,i=6,b=wye,y=0.204603,x=0.338319 +z=0.381399,KEYFIELD=eks,i=10,b=wye,y=0.381399,x=0.134189 +z=0.573289,KEYFIELD=wye,i=15,b=pan,y=0.573289,x=0.863624

@@ -452,11 +453,11 @@ a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

 $ mlr put '$nr = NR' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "nr": 1 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "nr": 2 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "nr": 3 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "nr": 4 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "nr": 5 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,nr=1
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,nr=2
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,nr=3
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,nr=4
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,nr=5
 

@@ -468,8 +469,8 @@ $ mlr put '$nr = NR' data/small

 $ mlr filter '$a == "wye"' then put '$nr = NR' data/small
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "nr": 3 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "nr": 5 }
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,nr=3
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,nr=5
 

@@ -480,8 +481,8 @@ $ mlr filter '$a == "wye"' then put '$nr = NR' data/small

 $ mlr filter '$a == "wye"' then cat -n data/small
-{ "n": 1, "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "n": 2, "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+n=1,a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+n=2,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -492,8 +493,8 @@ $ mlr filter '$a == "wye"' then cat -n data/small

 $ mlr filter '$a == "wye"' then put 'begin {@n = 1} $n = @n; @n += 1' data/small
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "n": 1 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "n": 2 }
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,n=1
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,n=2
 

@@ -876,16 +877,16 @@ $ mlr --from data/miss-date.csv --icsv \ then put '$datestamp = strptime($date, "%Y-%m-%d")' \ then step -a delta -f datestamp \ | head -{ "n": 1, "date": "2012-03-05", "qoh": 10055, "datestamp": 1330905600.000000, "datestamp_delta": 0 } -{ "n": 2, "date": "2012-03-06", "qoh": 10486, "datestamp": 1330992000.000000, "datestamp_delta": 86400.000000 } -{ "n": 3, "date": "2012-03-07", "qoh": 10430, "datestamp": 1331078400.000000, "datestamp_delta": 86400.000000 } -{ "n": 4, "date": "2012-03-08", "qoh": 10674, "datestamp": 1331164800.000000, "datestamp_delta": 86400.000000 } -{ "n": 5, "date": "2012-03-09", "qoh": 10880, "datestamp": 1331251200.000000, "datestamp_delta": 86400.000000 } -{ "n": 6, "date": "2012-03-10", "qoh": 10718, "datestamp": 1331337600.000000, "datestamp_delta": 86400.000000 } -{ "n": 7, "date": "2012-03-11", "qoh": 10795, "datestamp": 1331424000.000000, "datestamp_delta": 86400.000000 } -{ "n": 8, "date": "2012-03-12", "qoh": 11043, "datestamp": 1331510400.000000, "datestamp_delta": 86400.000000 } -{ "n": 9, "date": "2012-03-13", "qoh": 11177, "datestamp": 1331596800.000000, "datestamp_delta": 86400.000000 } -{ "n": 10, "date": "2012-03-14", "qoh": 11498, "datestamp": 1331683200.000000, "datestamp_delta": 86400.000000 } +n=1,date=2012-03-05,qoh=10055,datestamp=1330905600.000000,datestamp_delta=0 +n=2,date=2012-03-06,qoh=10486,datestamp=1330992000.000000,datestamp_delta=86400.000000 +n=3,date=2012-03-07,qoh=10430,datestamp=1331078400.000000,datestamp_delta=86400.000000 +n=4,date=2012-03-08,qoh=10674,datestamp=1331164800.000000,datestamp_delta=86400.000000 +n=5,date=2012-03-09,qoh=10880,datestamp=1331251200.000000,datestamp_delta=86400.000000 +n=6,date=2012-03-10,qoh=10718,datestamp=1331337600.000000,datestamp_delta=86400.000000 +n=7,date=2012-03-11,qoh=10795,datestamp=1331424000.000000,datestamp_delta=86400.000000 +n=8,date=2012-03-12,qoh=11043,datestamp=1331510400.000000,datestamp_delta=86400.000000 +n=9,date=2012-03-13,qoh=11177,datestamp=1331596800.000000,datestamp_delta=86400.000000 +n=10,date=2012-03-14,qoh=11498,datestamp=1331683200.000000,datestamp_delta=86400.000000

@@ -900,8 +901,8 @@ $ mlr --from data/miss-date.csv --icsv \ then put '$datestamp = strptime($date, "%Y-%m-%d")' \ then step -a delta -f datestamp \ then filter '$datestamp_delta != 86400 && $n != 1' -{ "n": 774, "date": "2014-04-19", "qoh": 130140, "datestamp": 1397865600.000000, "datestamp_delta": 259200.000000 } -{ "n": 1119, "date": "2015-03-31", "qoh": 181625, "datestamp": 1427760000.000000, "datestamp_delta": 172800.000000 } +n=774,date=2014-04-19,qoh=130140,datestamp=1397865600.000000,datestamp_delta=259200.000000 +n=1119,date=2015-03-31,qoh=181625,datestamp=1427760000.000000,datestamp_delta=172800.000000

@@ -912,17 +913,17 @@ $ mlr --from data/miss-date.csv --icsv \

 $ mlr cat -n then filter '$n >= 770 && $n <= 780' data/miss-date.csv
-{ "n": 770, "1": "2014-04-12", "2": 129435 }
-{ "n": 771, "1": "2014-04-13", "2": 129868 }
-{ "n": 772, "1": "2014-04-14", "2": 129797 }
-{ "n": 773, "1": "2014-04-15", "2": 129919 }
-{ "n": 774, "1": "2014-04-16", "2": 130181 }
-{ "n": 775, "1": "2014-04-19", "2": 130140 }
-{ "n": 776, "1": "2014-04-20", "2": 130271 }
-{ "n": 777, "1": "2014-04-21", "2": 130368 }
-{ "n": 778, "1": "2014-04-22", "2": 130368 }
-{ "n": 779, "1": "2014-04-23", "2": 130849 }
-{ "n": 780, "1": "2014-04-24", "2": 131026 }
+n=770,1=2014-04-12,2=129435
+n=771,1=2014-04-13,2=129868
+n=772,1=2014-04-14,2=129797
+n=773,1=2014-04-15,2=129919
+n=774,1=2014-04-16,2=130181
+n=775,1=2014-04-19,2=130140
+n=776,1=2014-04-20,2=130271
+n=777,1=2014-04-21,2=130368
+n=778,1=2014-04-22,2=130368
+n=779,1=2014-04-23,2=130849
+n=780,1=2014-04-24,2=131026
 

@@ -930,17 +931,17 @@ $ mlr cat -n then filter '$n >= 770 && $n <= 780' data/miss-date.c

 $ mlr cat -n then filter '$n >= 1115 && $n <= 1125' data/miss-date.csv
-{ "n": 1115, "1": "2015-03-25", "2": 181006 }
-{ "n": 1116, "1": "2015-03-26", "2": 180995 }
-{ "n": 1117, "1": "2015-03-27", "2": 181043 }
-{ "n": 1118, "1": "2015-03-28", "2": 181112 }
-{ "n": 1119, "1": "2015-03-29", "2": 181306 }
-{ "n": 1120, "1": "2015-03-31", "2": 181625 }
-{ "n": 1121, "1": "2015-04-01", "2": 181494 }
-{ "n": 1122, "1": "2015-04-02", "2": 181718 }
-{ "n": 1123, "1": "2015-04-03", "2": 181835 }
-{ "n": 1124, "1": "2015-04-04", "2": 182104 }
-{ "n": 1125, "1": "2015-04-05", "2": 182528 }
+n=1115,1=2015-03-25,2=181006
+n=1116,1=2015-03-26,2=180995
+n=1117,1=2015-03-27,2=181043
+n=1118,1=2015-03-28,2=181112
+n=1119,1=2015-03-29,2=181306
+n=1120,1=2015-03-31,2=181625
+n=1121,1=2015-04-01,2=181494
+n=1122,1=2015-04-02,2=181718
+n=1123,1=2015-04-03,2=181835
+n=1124,1=2015-04-04,2=182104
+n=1125,1=2015-04-05,2=182528
 

@@ -1215,13 +1216,13 @@ $ mlr --from data/rect.txt put -q ' is_present($inner1) { emit @r }' -{ "outer": 1, "middle": 10, "inner1": 100, "inner2": 101 } -{ "outer": 1, "middle": 12, "inner1": 120, "inner2": 121 } -{ "outer": 2, "middle": 20, "inner1": 200, "inner2": 201 } -{ "outer": 2, "middle": 21, "inner1": 210, "inner2": 211 } -{ "outer": 3, "middle": 30, "inner1": 300, "inner2": 301 } -{ "outer": 3, "middle": 31, "inner1": 312, "inner2": 301 } -{ "outer": 3, "middle": 31, "inner1": 313, "inner2": 314 } +outer=1,middle=10,inner1=100,inner2=101 +outer=1,middle=12,inner1=120,inner2=121 +outer=2,middle=20,inner1=200,inner2=201 +outer=2,middle=21,inner1=210,inner2=211 +outer=3,middle=30,inner1=300,inner2=301 +outer=3,middle=31,inner1=312,inner2=301 +outer=3,middle=31,inner1=313,inner2=314

diff --git a/doc/cookbook2.html b/doc/cookbook2.html index 8b93ac1a7..a661279a9 100644 --- a/doc/cookbook2.html +++ b/doc/cookbook2.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 @@ -285,11 +286,11 @@ $ mlr --from data/medium put -q ' #emit mean, "a"; emit (wmean, mean), "a"; }' -{ "a": "pan", "wmean": 4979.563722, "mean": 5028.259010 } -{ "a": "eks", "wmean": 4890.381593, "mean": 4956.290076 } -{ "a": "wye", "wmean": 4946.987746, "mean": 4920.001017 } -{ "a": "zee", "wmean": 5164.719685, "mean": 5123.092330 } -{ "a": "hat", "wmean": 4925.533162, "mean": 4967.743946 } +a=pan,wmean=4979.563722,mean=5028.259010 +a=eks,wmean=4890.381593,mean=4956.290076 +a=wye,wmean=4946.987746,mean=4920.001017 +a=zee,wmean=5164.719685,mean=5123.092330 +a=hat,wmean=4925.533162,mean=4967.743946

diff --git a/doc/cookbook3.html b/doc/cookbook3.html index a8face091..e9382ef10 100644 --- a/doc/cookbook3.html +++ b/doc/cookbook3.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 diff --git a/doc/customization.html b/doc/customization.html new file mode 100644 index 000000000..333e3e9df --- /dev/null +++ b/doc/customization.html @@ -0,0 +1,233 @@ + + + + + + + + + + + + Customization + + + + + + + + + + + + + + +

+
Miller
+ + +
+Overview +  +Using +  +Reference +  +Background +  +Repository +  +
+
FAQ +
Customization +
Mixing with other languages +
Cookbook part 1 +
Cookbook part 2 +
Cookbook part 3 +
Data-diving examples +
+ + +

+ + +

+
Customization
+• 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

+ +
+ +
    + +
  • You can include any command-line flags, except the "terminal" ones such + as --help.
  • + +
  • The formatting rule is you need to put one flag beginning with + -- per line: for example, --csv on one line and + --nr-progress-mod 1000 on a separate line.
  • + +
  • Since every line starts with a -- option, you can leave off the + initial -- if you want. For example, ojson is the same as + --ojson, and nr-progress-mod 1000 is the same as + --nr-progress-mod 1000. + +
  • Comments are from a # to the end of the line.
  • + +
  • Empty lines are ignored -- including lines which are empty after comments are removed.
  • + +
+ +

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

+ +
+ +
    + +
  • If the environment variable MLRRC is set:
  • + +
      +
    • If its value is __none__ then no .mlrrc files are processed. + (This is nice for things like regression testing.)
    • +
    • Otherwise, its value (as a filename) is loaded and processed. If there + are syntax errors, they abort mlr with a usage message (as if + you had mistyped something on the command line). If the file can't be loaded at + all, though, it is silently skipped.
    • +
    • Any .mlrrc in your home directory or current directory is ignored whenever + MLRRC is set in the environment. +
    + +
  • Otherwise: + +
      +
    • If $HOME/.mlrrc exists, it’s processed as above.
    • +
    • If ./.mlrrc exists, it’s then also processed as above.
    • +
    • The idea is you can have all your settings in your $HOME/.mlrrc, + then override maybe one or two for your current directory if you like.
    • +
    + +
+ +
+ + + + + + + + diff --git a/doc/data-examples.html b/doc/data-examples.html index 6f4c434e3..ae635c3f7 100644 --- a/doc/data-examples.html +++ b/doc/data-examples.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 diff --git a/doc/data-sharing.html b/doc/data-sharing.html index 5652a1d27..8aa57044a 100644 --- a/doc/data-sharing.html +++ b/doc/data-sharing.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 diff --git a/doc/faq.html b/doc/faq.html index 50262ca03..59961ee45 100644 --- a/doc/faq.html +++ b/doc/faq.html @@ -50,6 +50,7 @@ pageTracker._trackPageview();  

FAQ +
Customization
Mixing with other languages
Cookbook part 1
Cookbook part 2 @@ -596,7 +597,7 @@ Name=Khavari, Darius^ARole=tester
 $ echo 'x.a=3,y:b=4,z/c=5' | mlr put '${product.all} = ${x.a} * ${y:b} * ${z/c}'
-{ "x.a": 3, "y": {"b": 4 },"z/c": 5, "product.all": 60 }
+x.a=3,y:b=4,z/c=5,product.all=60
 

@@ -660,7 +661,7 @@ $a = "It's OK, I said, then 'for now'."

 $ echo a=bcd | mlr put -f data/single-quote-example.mlr
-{ "a": "It's OK, I said, then 'for now'." }
+a=It's OK, I said, then 'for now'.
 

@@ -675,7 +676,7 @@ strings, no problem.

 $ echo a=bcd | mlr put '$a="It'\''s OK, I said, '\''for now'\''."'
-{ "a": "It's OK, I said, 'for now'." }
+a=It's OK, I said, 'for now'.
 

@@ -720,11 +721,11 @@ a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

 $ mlr cut -f x,i,a data/small
-{ "a": "pan", "i": 1, "x": 0.3467901443380824 }
-{ "a": "eks", "i": 2, "x": 0.7586799647899636 }
-{ "a": "wye", "i": 3, "x": 0.20460330576630303 }
-{ "a": "eks", "i": 4, "x": 0.38139939387114097 }
-{ "a": "wye", "i": 5, "x": 0.5732889198020006 }
+a=pan,i=1,x=0.3467901443380824
+a=eks,i=2,x=0.7586799647899636
+a=wye,i=3,x=0.20460330576630303
+a=eks,i=4,x=0.38139939387114097
+a=wye,i=5,x=0.5732889198020006
 

@@ -739,11 +740,11 @@ command, which has the same semantics.

 $ mlr cut -o -f x,i,a data/small
-{ "x": 0.3467901443380824, "i": 1, "a": "pan" }
-{ "x": 0.7586799647899636, "i": 2, "a": "eks" }
-{ "x": 0.20460330576630303, "i": 3, "a": "wye" }
-{ "x": 0.38139939387114097, "i": 4, "a": "eks" }
-{ "x": 0.5732889198020006, "i": 5, "a": "wye" }
+x=0.3467901443380824,i=1,a=pan
+x=0.7586799647899636,i=2,a=eks
+x=0.20460330576630303,i=3,a=wye
+x=0.38139939387114097,i=4,a=eks
+x=0.5732889198020006,i=5,a=wye
 

@@ -773,8 +774,8 @@ why don’t I see NR=1 and NR=2 here??

 $ mlr filter '$x > 0.5' then put '$NR = NR' data/small
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "NR": 2 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "NR": 5 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,NR=2
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,NR=5
 

@@ -787,7 +788,7 @@ current record, and if you add/remove a field, the value of NF will

 $ echo x=1,y=2,z=3 | mlr put '$nf1 = NF; $u = 4; $nf2 = NF; unset $x,$y,$z; $nf3 = NF'
-{ "nf1": 3, "u": 4, "nf2": 5, "nf3": 3 }
+nf1=3,u=4,nf2=5,nf3=3
 

@@ -823,8 +824,8 @@ wye pan 5 0.5732889198020006 0.8636244699032729 5 2

 $ mlr filter '$x > 0.5' then cat -n data/small
-{ "n": 1, "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "n": 2, "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+n=1,a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+n=2,a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

diff --git a/doc/file-formats.html b/doc/file-formats.html index 892229f88..98892f19c 100644 --- a/doc/file-formats.html +++ b/doc/file-formats.html @@ -255,11 +255,11 @@ Miller’s default file format is DKVP, for delimited key-value pairs

 $ mlr cat data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

diff --git a/doc/poki-cfg.json b/doc/poki-cfg.json index 0a30e45cd..a69f440d0 100644 --- a/doc/poki-cfg.json +++ b/doc/poki-cfg.json @@ -41,6 +41,10 @@ "external_name": "FAQ", "file_name": "faq.html" }, + { + "external_name": "Customization", + "file_name": "customization.html" + }, { "external_name": "Mixing with other languages", "file_name": "data-sharing.html" diff --git a/doc/record-heterogeneity.html b/doc/record-heterogeneity.html index 87d917778..33e1a1620 100644 --- a/doc/record-heterogeneity.html +++ b/doc/record-heterogeneity.html @@ -320,13 +320,13 @@ count=450

 $ mlr sort -n count data/sort-het.dkvp
-{ "count": 100, "color": "green" }
-{ "status": "ok", "count": 200, "hours": 3.4 }
-{ "status": "ok", "count": 250, "hours": 0.22 }
-{ "count": 300, "color": "blue" }
-{ "count": 450 }
-{ "count": 500, "color": "green" }
-{ "count": 600 }
+count=100,color=green
+status=ok,count=200,hours=3.4
+status=ok,count=250,hours=0.22
+count=300,color=blue
+count=450
+count=500,color=green
+count=600
 

diff --git a/doc/reference-dsl.html b/doc/reference-dsl.html index 9339c2396..fa46e1a6e 100644 --- a/doc/reference-dsl.html +++ b/doc/reference-dsl.html @@ -131,9 +131,9 @@ pageTracker._trackPageview();

 $ mlr stats1 -a sum -f x -g a data/small
-{ "a": "pan", "x_sum": 0.346790 }
-{ "a": "eks", "x_sum": 1.140079 }
-{ "a": "wye", "x_sum": 0.777892 }
+a=pan,x_sum=0.346790
+a=eks,x_sum=1.140079
+a=wye,x_sum=0.777892
 

@@ -152,9 +152,9 @@ $ mlr stats1 -a sum -f x -g a data/small

 $ mlr  put -q '@x_sum[$a] += $x; end{emit @x_sum, "a"}' data/small
-{ "a": "pan", "x_sum": 0.346790 }
-{ "a": "eks", "x_sum": 1.140079 }
-{ "a": "wye", "x_sum": 0.777892 }
+a=pan,x_sum=0.346790
+a=eks,x_sum=1.140079
+a=wye,x_sum=0.777892
 

@@ -194,8 +194,8 @@ a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

 $ mlr filter '$a == "eks"' data/small
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
 

@@ -206,11 +206,11 @@ $ mlr filter '$a == "eks"' data/small

 $ mlr put '$ab = $a . "_" . $b ' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "ab": "pan_pan" }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "ab": "eks_pan" }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "ab": "wye_wye" }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "ab": "eks_wye" }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "ab": "wye_pan" }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,ab=pan_pan
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,ab=eks_pan
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,ab=wye_wye
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,ab=eks_wye
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,ab=wye_pan
 

@@ -314,11 +314,11 @@ x_y_corr

 $ mlr --from data/small put '$xy = sqrt($x**2 + $y**2)'
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "xy": 0.805299 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "xy": 0.920998 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "xy": 0.395376 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "xy": 0.404317 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "xy": 1.036584 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,xy=0.805299
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,xy=0.920998
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,xy=0.395376
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,xy=0.404317
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,xy=1.036584
 

@@ -326,11 +326,11 @@ $ mlr --from data/small put '$xy = sqrt($x**2 + $y**2)'

 $ mlr --from data/small put 'func f(a, b) { return sqrt(a**2 + b**2) } $xy = f($x, $y)'
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "xy": 0.805299 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "xy": 0.920998 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "xy": 0.395376 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "xy": 0.404317 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "xy": 1.036584 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,xy=0.805299
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,xy=0.920998
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,xy=0.395376
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,xy=0.404317
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,xy=1.036584
 

@@ -353,11 +353,11 @@ $xy = f($x, $y)

 $ mlr --from data/small put -f data/fe-example-3.mlr
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "xy": 0.805299 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "xy": 0.920998 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "xy": 0.395376 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "xy": 0.404317 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "xy": 1.036584 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,xy=0.805299
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,xy=0.920998
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,xy=0.395376
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,xy=0.404317
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,xy=1.036584
 

@@ -379,11 +379,11 @@ func f(a, b) {

 $ mlr --from data/small put -f data/fe-example-4.mlr -e '$xy = f($x, $y)'
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "xy": 0.805299 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "xy": 0.920998 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "xy": 0.395376 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "xy": 0.404317 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "xy": 1.036584 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,xy=0.805299
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,xy=0.920998
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,xy=0.395376
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,xy=0.404317
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,xy=1.036584
 

@@ -424,7 +424,7 @@ mlr put 'x=1;;;;$y=2;'

 $ echo x=1,y=2 | mlr put 'while (NF < 10) { $[NF+1] = ""}  $foo = "bar"'
-{ "x": 1, "y": 2, "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "foo": "bar" }
+x=1,y=2,3=,4=,5=,6=,7=,8=,9=,10=,foo=bar
 

@@ -432,7 +432,7 @@ $ echo x=1,y=2 | mlr put 'while (NF < 10) { $[NF+1] = ""} $foo = "bar"'

 $ echo x=1,y=2 | mlr put 'while (NF < 10) { $[NF+1] = ""}; $foo = "bar"'
-{ "x": 1, "y": 2, "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "foo": "bar" }
+x=1,y=2,3=,4=,5=,6=,7=,8=,9=,10=,foo=bar
 

@@ -569,9 +569,9 @@ variables, e.g. ENV["HOME"] or ENV["foo_".$hostname].

 $ mlr filter 'FNR == 2' data/small*
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "1": "pan", "2": "pan", "3": 1, "4": 0.3467901443380824, "5": 0.7268028627434533 }
-{ "a": "wye", "b": "eks", "i": 10000, "x": 0.734806020620654365, "y": 0.884788571337605134 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+1=pan,2=pan,3=1,4=0.3467901443380824,5=0.7268028627434533
+a=wye,b=eks,i=10000,x=0.734806020620654365,y=0.884788571337605134
 

@@ -580,22 +580,22 @@ $ mlr filter 'FNR == 2' data/small*

 $ mlr put '$fnr = FNR' data/small*
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "fnr": 1 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "fnr": 2 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "fnr": 3 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "fnr": 4 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "fnr": 5 }
-{ "1": "a", "2": "b", "3": "i", "4": "x", "5": "y", "fnr": 1 }
-{ "1": "pan", "2": "pan", "3": 1, "4": 0.3467901443380824, "5": 0.7268028627434533, "fnr": 2 }
-{ "1": "eks", "2": "pan", "3": 2, "4": 0.7586799647899636, "5": 0.5221511083334797, "fnr": 3 }
-{ "1": "wye", "2": "wye", "3": 3, "4": 0.20460330576630303, "5": 0.33831852551664776, "fnr": 4 }
-{ "1": "eks", "2": "wye", "3": 4, "4": 0.38139939387114097, "5": 0.13418874328430463, "fnr": 5 }
-{ "1": "wye", "2": "pan", "3": 5, "4": 0.5732889198020006, "5": 0.8636244699032729, "fnr": 6 }
-{ "a": "pan", "b": "eks", "i": 9999, "x": 0.267481232652199086, "y": 0.557077185510228001, "fnr": 1 }
-{ "a": "wye", "b": "eks", "i": 10000, "x": 0.734806020620654365, "y": 0.884788571337605134, "fnr": 2 }
-{ "a": "pan", "b": "wye", "i": 10001, "x": 0.870530722602517626, "y": 0.009854780514656930, "fnr": 3 }
-{ "a": "hat", "b": "wye", "i": 10002, "x": 0.321507044286237609, "y": 0.568893318795083758, "fnr": 4 }
-{ "a": "pan", "b": "zee", "i": 10003, "x": 0.272054845593895200, "y": 0.425789896597056627, "fnr": 5 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,fnr=1
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,fnr=2
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,fnr=3
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,fnr=4
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,fnr=5
+1=a,2=b,3=i,4=x,5=y,fnr=1
+1=pan,2=pan,3=1,4=0.3467901443380824,5=0.7268028627434533,fnr=2
+1=eks,2=pan,3=2,4=0.7586799647899636,5=0.5221511083334797,fnr=3
+1=wye,2=wye,3=3,4=0.20460330576630303,5=0.33831852551664776,fnr=4
+1=eks,2=wye,3=4,4=0.38139939387114097,5=0.13418874328430463,fnr=5
+1=wye,2=pan,3=5,4=0.5732889198020006,5=0.8636244699032729,fnr=6
+a=pan,b=eks,i=9999,x=0.267481232652199086,y=0.557077185510228001,fnr=1
+a=wye,b=eks,i=10000,x=0.734806020620654365,y=0.884788571337605134,fnr=2
+a=pan,b=wye,i=10001,x=0.870530722602517626,y=0.009854780514656930,fnr=3
+a=hat,b=wye,i=10002,x=0.321507044286237609,y=0.568893318795083758,fnr=4
+a=pan,b=zee,i=10003,x=0.272054845593895200,y=0.425789896597056627,fnr=5
 

@@ -675,7 +675,7 @@ $ echo a=3,b=4 | mlr filter '$["x"] < 0.5'

 $ echo s=green,t=blue,a=3,b=4 | mlr put '$[$s."_".$t] = $a * $b'
-{ "s": "green", "t": "blue", "a": 3, "b": 4, "green_blue": 12 }
+s=green,t=blue,a=3,b=4,green_blue=12
 

@@ -715,11 +715,11 @@ This has the shorter equivalent notation $[[[3]]].

 $ mlr cat data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -728,11 +728,11 @@ $ mlr cat data/small

 $ mlr put '$[[3]] = "NEW"' data/small
-{ "a": "pan", "b": "pan", "NEW": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "NEW": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "NEW": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "NEW": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "NEW": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,NEW=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,NEW=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,NEW=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,NEW=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,NEW=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -740,11 +740,11 @@ $ mlr put '$[[3]] = "NEW"' data/small

 $ mlr put '$[[[3]]] = "NEW"' data/small
-{ "a": "pan", "b": "pan", "i": "NEW", "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": "NEW", "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": "NEW", "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": "NEW", "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": "NEW", "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=NEW,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=NEW,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=NEW,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=NEW,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=NEW,x=0.5732889198020006,y=0.8636244699032729
 

@@ -752,11 +752,11 @@ $ mlr put '$[[[3]]] = "NEW"' data/small

 $ mlr put '$NEW = $[[NR]]' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "NEW": "a" }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "NEW": "b" }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "NEW": "i" }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "NEW": "x" }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "NEW": "y" }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,NEW=a
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,NEW=b
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,NEW=i
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,NEW=x
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,NEW=y
 

@@ -764,11 +764,11 @@ $ mlr put '$NEW = $[[NR]]' data/small

 $ mlr put '$NEW = $[[[NR]]]' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533, "NEW": "pan" }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "NEW": "pan" }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776, "NEW": 3 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463, "NEW": 0.381399 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "NEW": 0.863624 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533,NEW=pan
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,NEW=pan
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776,NEW=3
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463,NEW=0.381399
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,NEW=0.863624
 

@@ -776,11 +776,11 @@ $ mlr put '$NEW = $[[[NR]]]' data/small

 $ mlr put '$[[[NR]]] = "NEW"' data/small
-{ "a": "NEW", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "NEW", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": "NEW", "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": "NEW", "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": "NEW" }
+a=NEW,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=NEW,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=NEW,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=NEW,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=NEW
 

@@ -795,11 +795,11 @@ field results in a no-op.

 $ mlr put '$[[6]] = "NEW"' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -807,11 +807,11 @@ $ mlr put '$[[6]] = "NEW"' data/small

 $ mlr put '$[[[6]]] = "NEW"' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -839,7 +839,7 @@ with special characters such as . then you can use braces, e

 $ echo s=green,t=blue,a=3,b=4 | mlr put -q '@[$s."_".$t] = $a * $b; emit all'
-{ "green_blue": 12 }
+green_blue=12
 

@@ -862,10 +862,10 @@ a=4,b=5,c=6

 $ mlr put '@sum += $a; end {emit @sum}' then put 'is_present($a) {$a=10*$a; @sum += $a}; end {emit @sum}' data/a.dkvp
-{ "a": 10, "b": 2, "c": 3 }
-{ "a": 40, "b": 5, "c": 6 }
-{ "sum": 5 }
-{ "sum": 50 }
+a=10,b=2,c=3
+a=40,b=5,c=6
+sum=5
+sum=50
 

@@ -893,16 +893,16 @@ $ mlr put -q ' emit @x_sum, "a"; } ' ../data/small -{ "a": "pan", "x_count": 2 } -{ "a": "eks", "x_count": 3 } -{ "a": "wye", "x_count": 2 } -{ "a": "zee", "x_count": 2 } -{ "a": "hat", "x_count": 1 } -{ "a": "pan", "x_sum": 0.849416 } -{ "a": "eks", "x_sum": 1.751863 } -{ "a": "wye", "x_sum": 0.777892 } -{ "a": "zee", "x_sum": 1.125680 } -{ "a": "hat", "x_sum": 0.031442 } +a=pan,x_count=2 +a=eks,x_count=3 +a=wye,x_count=2 +a=zee,x_count=2 +a=hat,x_count=1 +a=pan,x_sum=0.849416 +a=eks,x_sum=1.751863 +a=wye,x_sum=0.777892 +a=zee,x_sum=1.125680 +a=hat,x_sum=0.031442

@@ -910,11 +910,11 @@ $ mlr put -q '

 $ mlr stats1 -a count,sum -f x -g a ../data/small
-{ "a": "pan", "x_count": 2, "x_sum": 0.849416 }
-{ "a": "eks", "x_count": 3, "x_sum": 1.751863 }
-{ "a": "wye", "x_count": 2, "x_sum": 0.777892 }
-{ "a": "zee", "x_count": 2, "x_sum": 1.125680 }
-{ "a": "hat", "x_count": 1, "x_sum": 0.031442 }
+a=pan,x_count=2,x_sum=0.849416
+a=eks,x_count=3,x_sum=1.751863
+a=wye,x_count=2,x_sum=0.777892
+a=zee,x_count=2,x_sum=1.125680
+a=hat,x_count=1,x_sum=0.031442
 

@@ -931,31 +931,31 @@ $ mlr --from data/medium put -q ' emit (@x_count, @x_sum), "a", "b"; } ' -{ "a": "pan", "b": "pan", "x_count": 427, "x_sum": 219.185129 } -{ "a": "pan", "b": "wye", "x_count": 395, "x_sum": 198.432931 } -{ "a": "pan", "b": "eks", "x_count": 429, "x_sum": 216.075228 } -{ "a": "pan", "b": "hat", "x_count": 417, "x_sum": 205.222776 } -{ "a": "pan", "b": "zee", "x_count": 413, "x_sum": 205.097518 } -{ "a": "eks", "b": "pan", "x_count": 371, "x_sum": 179.963030 } -{ "a": "eks", "b": "wye", "x_count": 407, "x_sum": 196.945286 } -{ "a": "eks", "b": "zee", "x_count": 357, "x_sum": 176.880365 } -{ "a": "eks", "b": "eks", "x_count": 413, "x_sum": 215.916097 } -{ "a": "eks", "b": "hat", "x_count": 417, "x_sum": 208.783171 } -{ "a": "wye", "b": "wye", "x_count": 377, "x_sum": 185.295850 } -{ "a": "wye", "b": "pan", "x_count": 392, "x_sum": 195.847900 } -{ "a": "wye", "b": "hat", "x_count": 426, "x_sum": 212.033183 } -{ "a": "wye", "b": "zee", "x_count": 385, "x_sum": 194.774048 } -{ "a": "wye", "b": "eks", "x_count": 386, "x_sum": 204.812961 } -{ "a": "zee", "b": "pan", "x_count": 389, "x_sum": 202.213804 } -{ "a": "zee", "b": "wye", "x_count": 455, "x_sum": 233.991394 } -{ "a": "zee", "b": "eks", "x_count": 391, "x_sum": 190.961778 } -{ "a": "zee", "b": "zee", "x_count": 403, "x_sum": 206.640635 } -{ "a": "zee", "b": "hat", "x_count": 409, "x_sum": 191.300006 } -{ "a": "hat", "b": "wye", "x_count": 423, "x_sum": 208.883010 } -{ "a": "hat", "b": "zee", "x_count": 385, "x_sum": 196.349450 } -{ "a": "hat", "b": "eks", "x_count": 389, "x_sum": 189.006793 } -{ "a": "hat", "b": "hat", "x_count": 381, "x_sum": 182.853532 } -{ "a": "hat", "b": "pan", "x_count": 363, "x_sum": 168.553807 } +a=pan,b=pan,x_count=427,x_sum=219.185129 +a=pan,b=wye,x_count=395,x_sum=198.432931 +a=pan,b=eks,x_count=429,x_sum=216.075228 +a=pan,b=hat,x_count=417,x_sum=205.222776 +a=pan,b=zee,x_count=413,x_sum=205.097518 +a=eks,b=pan,x_count=371,x_sum=179.963030 +a=eks,b=wye,x_count=407,x_sum=196.945286 +a=eks,b=zee,x_count=357,x_sum=176.880365 +a=eks,b=eks,x_count=413,x_sum=215.916097 +a=eks,b=hat,x_count=417,x_sum=208.783171 +a=wye,b=wye,x_count=377,x_sum=185.295850 +a=wye,b=pan,x_count=392,x_sum=195.847900 +a=wye,b=hat,x_count=426,x_sum=212.033183 +a=wye,b=zee,x_count=385,x_sum=194.774048 +a=wye,b=eks,x_count=386,x_sum=204.812961 +a=zee,b=pan,x_count=389,x_sum=202.213804 +a=zee,b=wye,x_count=455,x_sum=233.991394 +a=zee,b=eks,x_count=391,x_sum=190.961778 +a=zee,b=zee,x_count=403,x_sum=206.640635 +a=zee,b=hat,x_count=409,x_sum=191.300006 +a=hat,b=wye,x_count=423,x_sum=208.883010 +a=hat,b=zee,x_count=385,x_sum=196.349450 +a=hat,b=eks,x_count=389,x_sum=189.006793 +a=hat,b=hat,x_count=381,x_sum=182.853532 +a=hat,b=pan,x_count=363,x_sum=168.553807

@@ -984,12 +984,12 @@ $ mlr put ' emitf @num_total, @num_positive } ' data/put-gating-example-1.dkvp -{ "x": -1 } -{ "x": 0 } -{ "x": 1, "y": 0.000000, "z": 0.000000 } -{ "x": 2, "y": 0.301030, "z": 0.548662 } -{ "x": 3, "y": 0.477121, "z": 0.690740 } -{ "num_total": 5, "num_positive": 3 } +x=-1 +x=0 +x=1,y=0.000000,z=0.000000 +x=2,y=0.301030,z=0.548662 +x=3,y=0.477121,z=0.690740 +num_total=5,num_positive=3

@@ -1027,16 +1027,16 @@ mlr --seed 12345 seqgen --start 1 --stop 10 then put ' num o = f(10, 20); # local to the top-level scope $o = o; ' -{ "i": 1, "o": 14.662901 } -{ "i": 2, "o": 17.881983 } -{ "i": 3, "o": 14.586560 } -{ "i": 4, "o": 16.402409 } -{ "i": 5, "o": 16.336598 } -{ "i": 6, "o": 14.622701 } -{ "i": 7, "o": 15.983753 } -{ "i": 8, "o": 13.852177 } -{ "i": 9, "o": 15.472899 } -{ "i": 10, "o": 15.643912 } +i=1,o=14.662901 +i=2,o=17.881983 +i=3,o=14.586560 +i=4,o=16.402409 +i=5,o=16.336598 +i=6,o=14.622701 +i=7,o=15.983753 +i=8,o=13.852177 +i=9,o=15.472899 +i=10,o=15.643912

@@ -1276,11 +1276,11 @@ $ mlr --from data/small put ' } $* = f({"a": $a, "x": $x}); ' -{ "a": "pan", "x": 69.358029 } -{ "a": "eks", "x": 151.735993 } -{ "a": "wye", "x": 40.920661 } -{ "a": "eks", "x": 76.279879 } -{ "a": "wye", "x": 114.657784 } +a=pan,x=69.358029 +a=eks,x=151.735993 +a=wye,x=40.920661 +a=eks,x=76.279879 +a=wye,x=114.657784

@@ -1552,11 +1552,11 @@ $ mlr --opprint put -q '@v["sum"] += $x; @v["count"] += 1; end{dump; @w = @v; du

 $ mlr put 'NR == 2 {@keep = $*}; NR == 4 {$* = @keep}' data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -1970,11 +1970,11 @@ domain restrictions, regex-matching, and so on:

 $ mlr cat data/put-gating-example-1.dkvp
-{ "x": -1 }
-{ "x": 0 }
-{ "x": 1 }
-{ "x": 2 }
-{ "x": 3 }
+x=-1
+x=0
+x=1
+x=2
+x=3
 

@@ -1982,11 +1982,11 @@ $ mlr cat data/put-gating-example-1.dkvp

 $ mlr put '$x > 0.0 { $y = log10($x); $z = sqrt($y) }' data/put-gating-example-1.dkvp
-{ "x": -1 }
-{ "x": 0 }
-{ "x": 1, "y": 0.000000, "z": 0.000000 }
-{ "x": 2, "y": 0.301030, "z": 0.548662 }
-{ "x": 3, "y": 0.477121, "z": 0.690740 }
+x=-1
+x=0
+x=1,y=0.000000,z=0.000000
+x=2,y=0.301030,z=0.548662
+x=3,y=0.477121,z=0.690740
 

@@ -1994,9 +1994,9 @@ $ mlr put '$x > 0.0 { $y = log10($x); $z = sqrt($y) }' data/put-gating-exampl

 $ mlr cat data/put-gating-example-2.dkvp
-{ "a": "abc_123" }
-{ "a": "some other name" }
-{ "a": "xyz_789" }
+a=abc_123
+a=some other name
+a=xyz_789
 

@@ -2004,9 +2004,9 @@ $ mlr cat data/put-gating-example-2.dkvp

 $ mlr put '$a =~ "([a-z]+)_([0-9]+)" { $b = "left_\1"; $c = "right_\2" }' data/put-gating-example-2.dkvp
-{ "a": "abc_123", "b": "left_abc", "c": "right_123" }
-{ "a": "some other name" }
-{ "a": "xyz_789", "b": "left_xyz", "c": "right_789" }
+a=abc_123,b=left_abc,c=right_123
+a=some other name
+a=xyz_789,b=left_xyz,c=right_789
 

@@ -2024,11 +2024,11 @@ subsequent assignments are done unconditionally:

 $ mlr put '$x > 0.0; $y = log10($x); $z = sqrt($y)' data/put-gating-example-1.dkvp
-{ "x": -1, "y": nan, "z": nan }
-{ "x": 0, "y": -inf, "z": nan }
-{ "x": 1, "y": 0.000000, "z": 0.000000 }
-{ "x": 2, "y": 0.301030, "z": 0.548662 }
-{ "x": 3, "y": 0.477121, "z": 0.690740 }
+x=-1,y=nan,z=nan
+x=0,y=-inf,z=nan
+x=1,y=0.000000,z=0.000000
+x=2,y=0.301030,z=0.548662
+x=3,y=0.477121,z=0.690740
 

@@ -2036,9 +2036,9 @@ $ mlr put '$x > 0.0; $y = log10($x); $z = sqrt($y)' data/put-gating-example-1

 $ mlr put '$a =~ "([a-z]+)_([0-9]+)"; $b = "left_\1"; $c = "right_\2"' data/put-gating-example-2.dkvp
-{ "a": "abc_123", "b": "left_abc", "c": "right_123" }
-{ "a": "some other name", "b": "left_", "c": "right_" }
-{ "a": "xyz_789", "b": "left_xyz", "c": "right_789" }
+a=abc_123,b=left_abc,c=right_123
+a=some other name,b=left_,c=right_
+a=xyz_789,b=left_xyz,c=right_789
 

@@ -2099,7 +2099,7 @@ $ echo x=1,y=2 | mlr put ' } $foo = "bar" ' -{ "x": 1, "y": 2, "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "foo": "bar" } +x=1,y=2,3=,4=,5=,6=,7=,8=,9=,10=,foo=bar

@@ -2115,7 +2115,7 @@ $ echo x=1,y=2 | mlr put ' } while (NF < 10); $foo = "bar" ' -{ "x": 1, "y": 2, "3": "", "4": "", "5": "", "foo": "bar" } +x=1,y=2,3=,4=,5=,foo=bar

@@ -2171,35 +2171,35 @@ NR = 1 key:i value:1 key:x value:0.346790 key:y value:0.726803 -{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 } +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 NR = 2 key:a value:eks key:b value:pan key:i value:2 key:x value:0.758680 key:y value:0.522151 -{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 } +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 NR = 3 key:a value:wye key:b value:wye key:i value:3 key:x value:0.204603 key:y value:0.338319 -{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 } +a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 NR = 4 key:a value:eks key:b value:wye key:i value:4 key:x value:0.381399 key:y value:0.134189 -{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 } +a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 NR = 5 key:a value:wye key:b value:pan key:i value:5 key:x value:0.573289 key:y value:0.863624 -{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 } +a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

@@ -2570,17 +2570,17 @@ $ mlr put ' @x_sum += $x; end { emit @x_sum } ' ../data/small -{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 } -{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 } -{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 } -{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 } -{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 } -{ "a": "zee", "b": "pan", "i": 6, "x": 0.5271261600918548, "y": 0.49322128674835697 } -{ "a": "eks", "b": "zee", "i": 7, "x": 0.6117840605678454, "y": 0.1878849191181694 } -{ "a": "zee", "b": "wye", "i": 8, "x": 0.5985540091064224, "y": 0.976181385699006 } -{ "a": "hat", "b": "wye", "i": 9, "x": 0.03144187646093577, "y": 0.7495507603507059 } -{ "a": "pan", "b": "wye", "i": 10, "x": 0.5026260055412137, "y": 0.9526183602969864 } -{ "x_sum": 4.536294 } +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +x_sum=4.536294

@@ -2597,17 +2597,17 @@ $ mlr put ' @x_sum += $x; end { emit @x_sum } ' ../data/small -{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "y": 0.7268028627434533 } -{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 } -{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 } -{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 } -{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 } -{ "a": "zee", "b": "pan", "i": 6, "x": 0.5271261600918548, "y": 0.49322128674835697 } -{ "a": "eks", "b": "zee", "i": 7, "x": 0.6117840605678454, "y": 0.1878849191181694 } -{ "a": "zee", "b": "wye", "i": 8, "x": 0.5985540091064224, "y": 0.976181385699006 } -{ "a": "hat", "b": "wye", "i": 9, "x": 0.03144187646093577, "y": 0.7495507603507059 } -{ "a": "pan", "b": "wye", "i": 10, "x": 0.5026260055412137, "y": 0.9526183602969864 } -{ "x_sum": 4.536294 } +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=eks,b=zee,i=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,y=0.976181385699006 +a=hat,b=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +x_sum=4.536294

@@ -2623,7 +2623,7 @@ $ mlr put -q ' @x_sum += $x; end { emit @x_sum } ' ../data/small -{ "x_sum": 4.536294 } +x_sum=4.536294

@@ -2641,8 +2641,8 @@ $ mlr put -q ' emit @x_sum; } ' ../data/small -{ "x_count": 10 } -{ "x_sum": 4.536294 } +x_count=10 +x_sum=4.536294

@@ -2653,7 +2653,7 @@ This is of course not much different than

 $ mlr stats1 -a count,sum -f x ../data/small
-{ "x_count": 10, "x_sum": 4.536294 }
+x_count=10,x_sum=4.536294
 

@@ -3011,7 +3011,7 @@ For emitf these mustn’t have indexing using @name[...]<

 $ mlr put -q '@count += 1; @x_sum += $x; @y_sum += $y; end { emitf @count, @x_sum, @y_sum}' data/small
-{ "count": 5, "x_sum": 2.264762, "y_sum": 2.585086 }
+count=5,x_sum=2.264762,y_sum=2.585086
 

@@ -3044,7 +3044,7 @@ $ mlr put -q '@sum += $x; end { dump }' data/small

 $ mlr put -q '@sum += $x; end { emit @sum }' data/small
-{ "sum": 2.264762 }
+sum=2.264762
 

@@ -3069,9 +3069,9 @@ $ mlr put -q '@sum[$a] += $x; end { dump }' data/small

 $ mlr put -q '@sum[$a] += $x; end { emit @sum, "a" }' data/small
-{ "a": "pan", "sum": 0.346790 }
-{ "a": "eks", "sum": 1.140079 }
-{ "a": "wye", "sum": 0.777892 }
+a=pan,sum=0.346790
+a=eks,sum=1.140079
+a=wye,sum=0.777892
 

@@ -3102,11 +3102,11 @@ $ mlr put -q '@sum[$a][$b] += $x; end { dump }' data/small

 $ mlr put -q '@sum[$a][$b] += $x; end { emit @sum, "a", "b" }' data/small
-{ "a": "pan", "b": "pan", "sum": 0.346790 }
-{ "a": "eks", "b": "pan", "sum": 0.758680 }
-{ "a": "eks", "b": "wye", "sum": 0.381399 }
-{ "a": "wye", "b": "wye", "sum": 0.204603 }
-{ "a": "wye", "b": "pan", "sum": 0.573289 }
+a=pan,b=pan,sum=0.346790
+a=eks,b=pan,sum=0.758680
+a=eks,b=wye,sum=0.381399
+a=wye,b=wye,sum=0.204603
+a=wye,b=pan,sum=0.573289
 

@@ -3147,11 +3147,11 @@ $ mlr put -q '@sum[$a][$b][$i] += $x; end { dump }' data/small

 $ mlr put -q '@sum[$a][$b][$i] += $x; end { emit @sum, "a", "b", "i" }' data/small
-{ "a": "pan", "b": "pan", "i": 1, "sum": 0.346790 }
-{ "a": "eks", "b": "pan", "i": 2, "sum": 0.758680 }
-{ "a": "eks", "b": "wye", "i": 4, "sum": 0.381399 }
-{ "a": "wye", "b": "wye", "i": 3, "sum": 0.204603 }
-{ "a": "wye", "b": "pan", "i": 5, "sum": 0.573289 }
+a=pan,b=pan,i=1,sum=0.346790
+a=eks,b=pan,i=2,sum=0.758680
+a=eks,b=wye,i=4,sum=0.381399
+a=wye,b=wye,i=3,sum=0.204603
+a=wye,b=pan,i=5,sum=0.573289
 

@@ -3189,9 +3189,9 @@ $ mlr put -q '@sum[$a][$b] += $x; end { dump }' data/small

 $ mlr put -q '@sum[$a][$b] += $x; end { emit @sum, "a" }' data/small
-{ "a": "pan", "pan": 0.346790 }
-{ "a": "eks", "pan": 0.758680, "wye": 0.381399 }
-{ "a": "wye", "wye": 0.204603, "pan": 0.573289 }
+a=pan,pan=0.346790
+a=eks,pan=0.758680,wye=0.381399
+a=wye,wye=0.204603,pan=0.573289
 

@@ -3199,9 +3199,9 @@ $ mlr put -q '@sum[$a][$b] += $x; end { emit @sum, "a" }' data/small

 $ mlr put -q '@sum[$a][$b] += $x; end { emit @sum }' data/small
-{ "pan": 0.346790 }
-{ "pan": 0.758680, "wye": 0.381399 }
-{ "wye": 0.204603, "pan": 0.573289 }
+pan=0.346790
+pan=0.758680,wye=0.381399
+wye=0.204603,pan=0.573289
 

@@ -3209,9 +3209,9 @@ $ mlr put -q '@sum[$a][$b] += $x; end { emit @sum }' data/small

 $ mlr put -q '@sum[$a][$b] += $x; end { emitp @sum, "a" }' data/small
-{ "a": "pan", "sum": {"pan": 0.346790 } }
-{ "a": "eks", "sum": {"pan": 0.758680, "wye": 0.381399 } }
-{ "a": "wye", "sum": {"wye": 0.204603, "pan": 0.573289 } }
+a=pan,sum:pan=0.346790
+a=eks,sum:pan=0.758680,sum:wye=0.381399
+a=wye,sum:wye=0.204603,sum:pan=0.573289
 

@@ -3219,7 +3219,7 @@ $ mlr put -q '@sum[$a][$b] += $x; end { emitp @sum, "a" }' data/small

 $ mlr put -q '@sum[$a][$b] += $x; end { emitp @sum }' data/small
-{ "sum": {"pan": {"pan": 0.346790 },"eks": {"pan": 0.758680, "wye": 0.381399 },"wye": {"wye": 0.204603, "pan": 0.573289 } } }
+sum:pan:pan=0.346790,sum:eks:pan=0.758680,sum:eks:wye=0.381399,sum:wye:wye=0.204603,sum:wye:pan=0.573289
 

@@ -3243,9 +3243,9 @@ keys for emitp (it defaults to a colon):

 $ mlr put -q --oflatsep / '@sum[$a][$b] += $x; end { emitp @sum, "a" }' data/small
-{ "a": "pan", "sum/pan": 0.346790 }
-{ "a": "eks", "sum/pan": 0.758680, "sum/wye": 0.381399 }
-{ "a": "wye", "sum/wye": 0.204603, "sum/pan": 0.573289 }
+a=pan,sum/pan=0.346790
+a=eks,sum/pan=0.758680,sum/wye=0.381399
+a=wye,sum/wye=0.204603,sum/pan=0.573289
 

@@ -3253,7 +3253,7 @@ $ mlr put -q --oflatsep / '@sum[$a][$b] += $x; end { emitp @sum, "a" }' data/sma

 $ mlr put -q --oflatsep / '@sum[$a][$b] += $x; end { emitp @sum }' data/small
-{ "sum/pan/pan": 0.346790, "sum/eks/pan": 0.758680, "sum/eks/wye": 0.381399, "sum/wye/wye": 0.204603, "sum/wye/pan": 0.573289 }
+sum/pan/pan=0.346790,sum/eks/pan=0.758680,sum/eks/wye=0.381399,sum/wye/wye=0.204603,sum/wye/pan=0.573289
 

@@ -3405,11 +3405,11 @@ a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729

 $ mlr put 'unset $x, $a' data/small
-{ "b": "pan", "i": 1, "y": 0.7268028627434533 }
-{ "b": "pan", "i": 2, "y": 0.5221511083334797 }
-{ "b": "wye", "i": 3, "y": 0.33831852551664776 }
-{ "b": "wye", "i": 4, "y": 0.13418874328430463 }
-{ "b": "pan", "i": 5, "y": 0.8636244699032729 }
+b=pan,i=1,y=0.7268028627434533
+b=pan,i=2,y=0.5221511083334797
+b=wye,i=3,y=0.33831852551664776
+b=wye,i=4,y=0.13418874328430463
+b=pan,i=5,y=0.8636244699032729
 

@@ -3492,8 +3492,8 @@ following two are synonymous:

 $ mlr filter 'NR==2 || NR==3' data/small
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
 

@@ -3501,8 +3501,8 @@ $ mlr filter 'NR==2 || NR==3' data/small

 $ mlr put 'filter NR==2 || NR==3' data/small
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
 

@@ -3514,9 +3514,9 @@ for the filter, and/or do other things in addition to the filter:

 $ mlr put '@running_sum += $x; filter @running_sum > 1.3' data/small
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "y": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "y": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729 }
+a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,y=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729
 

@@ -3524,8 +3524,8 @@ $ mlr put '@running_sum += $x; filter @running_sum > 1.3' data/small

 $ mlr put '$z = $x * $y; filter $z > 0.3' data/small
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "y": 0.5221511083334797, "z": 0.396146 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "y": 0.8636244699032729, "z": 0.495106 }
+a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797,z=0.396146
+a=wye,b=pan,i=5,x=0.5732889198020006,y=0.8636244699032729,z=0.495106
 

diff --git a/doc/reference-verbs.html b/doc/reference-verbs.html index e9eed5b66..059f9309a 100644 --- a/doc/reference-verbs.html +++ b/doc/reference-verbs.html @@ -148,9 +148,9 @@ More information about them can be found here.

 $ mlr stats1 -a sum -f x -g a data/small
-{ "a": "pan", "x_sum": 0.346790 }
-{ "a": "eks", "x_sum": 1.140079 }
-{ "a": "wye", "x_sum": 0.777892 }
+a=pan,x_sum=0.346790
+a=eks,x_sum=1.140079
+a=wye,x_sum=0.777892
 

@@ -169,9 +169,9 @@ $ mlr stats1 -a sum -f x -g a data/small

 $ mlr  put -q '@x_sum[$a] += $x; end{emit @x_sum, "a"}' data/small
-{ "a": "pan", "x_sum": 0.346790 }
-{ "a": "eks", "x_sum": 1.140079 }
-{ "a": "wye", "x_sum": 0.777892 }
+a=pan,x_sum=0.346790
+a=eks,x_sum=1.140079
+a=wye,x_sum=0.777892
 

@@ -207,7 +207,7 @@ Given fields with values of the form a,b,c,d,e,f emits a=b,c=d,e=f pairs.

 $ echo 'a,b,c,d,e,f' | mlr altkv
-{ "a": "b", "c": "d", "e": "f" }
+a=b,c=d,e=f
 

@@ -215,7 +215,7 @@ $ echo 'a,b,c,d,e,f' | mlr altkv

 $ echo 'a,b,c,d,e,f,g' | mlr altkv
-{ "a": "b", "c": "d", "e": "f", "4": "g" }
+a=b,c=d,e=f,4=g
 

@@ -612,7 +612,7 @@ Options:

 $ mlr count data/medium
-{ "count": 10000 }
+count=10000
 

@@ -621,11 +621,11 @@ $ mlr count data/medium

 $ mlr count -g a data/medium
-{ "a": "pan", "count": 2081 }
-{ "a": "eks", "count": 1965 }
-{ "a": "wye", "count": 1966 }
-{ "a": "zee", "count": 2047 }
-{ "a": "hat", "count": 1941 }
+a=pan,count=2081
+a=eks,count=1965
+a=wye,count=1966
+a=zee,count=2047
+a=hat,count=1941
 

@@ -634,31 +634,31 @@ $ mlr count -g a data/medium

 $ mlr count -g a,b data/medium
-{ "a": "pan", "b": "pan", "count": 427 }
-{ "a": "eks", "b": "pan", "count": 371 }
-{ "a": "wye", "b": "wye", "count": 377 }
-{ "a": "eks", "b": "wye", "count": 407 }
-{ "a": "wye", "b": "pan", "count": 392 }
-{ "a": "zee", "b": "pan", "count": 389 }
-{ "a": "eks", "b": "zee", "count": 357 }
-{ "a": "zee", "b": "wye", "count": 455 }
-{ "a": "hat", "b": "wye", "count": 423 }
-{ "a": "pan", "b": "wye", "count": 395 }
-{ "a": "zee", "b": "eks", "count": 391 }
-{ "a": "hat", "b": "zee", "count": 385 }
-{ "a": "hat", "b": "eks", "count": 389 }
-{ "a": "wye", "b": "hat", "count": 426 }
-{ "a": "pan", "b": "eks", "count": 429 }
-{ "a": "eks", "b": "eks", "count": 413 }
-{ "a": "hat", "b": "hat", "count": 381 }
-{ "a": "hat", "b": "pan", "count": 363 }
-{ "a": "zee", "b": "zee", "count": 403 }
-{ "a": "pan", "b": "hat", "count": 417 }
-{ "a": "pan", "b": "zee", "count": 413 }
-{ "a": "zee", "b": "hat", "count": 409 }
-{ "a": "wye", "b": "zee", "count": 385 }
-{ "a": "eks", "b": "hat", "count": 417 }
-{ "a": "wye", "b": "eks", "count": 386 }
+a=pan,b=pan,count=427
+a=eks,b=pan,count=371
+a=wye,b=wye,count=377
+a=eks,b=wye,count=407
+a=wye,b=pan,count=392
+a=zee,b=pan,count=389
+a=eks,b=zee,count=357
+a=zee,b=wye,count=455
+a=hat,b=wye,count=423
+a=pan,b=wye,count=395
+a=zee,b=eks,count=391
+a=hat,b=zee,count=385
+a=hat,b=eks,count=389
+a=wye,b=hat,count=426
+a=pan,b=eks,count=429
+a=eks,b=eks,count=413
+a=hat,b=hat,count=381
+a=hat,b=pan,count=363
+a=zee,b=zee,count=403
+a=pan,b=hat,count=417
+a=pan,b=zee,count=413
+a=zee,b=hat,count=409
+a=wye,b=zee,count=385
+a=eks,b=hat,count=417
+a=wye,b=eks,count=386
 

@@ -695,31 +695,31 @@ Options:

 $ mlr count-distinct -f a,b then sort -nr count data/medium
-{ "a": "zee", "b": "wye", "count": 455 }
-{ "a": "pan", "b": "eks", "count": 429 }
-{ "a": "pan", "b": "pan", "count": 427 }
-{ "a": "wye", "b": "hat", "count": 426 }
-{ "a": "hat", "b": "wye", "count": 423 }
-{ "a": "pan", "b": "hat", "count": 417 }
-{ "a": "eks", "b": "hat", "count": 417 }
-{ "a": "eks", "b": "eks", "count": 413 }
-{ "a": "pan", "b": "zee", "count": 413 }
-{ "a": "zee", "b": "hat", "count": 409 }
-{ "a": "eks", "b": "wye", "count": 407 }
-{ "a": "zee", "b": "zee", "count": 403 }
-{ "a": "pan", "b": "wye", "count": 395 }
-{ "a": "wye", "b": "pan", "count": 392 }
-{ "a": "zee", "b": "eks", "count": 391 }
-{ "a": "zee", "b": "pan", "count": 389 }
-{ "a": "hat", "b": "eks", "count": 389 }
-{ "a": "wye", "b": "eks", "count": 386 }
-{ "a": "hat", "b": "zee", "count": 385 }
-{ "a": "wye", "b": "zee", "count": 385 }
-{ "a": "hat", "b": "hat", "count": 381 }
-{ "a": "wye", "b": "wye", "count": 377 }
-{ "a": "eks", "b": "pan", "count": 371 }
-{ "a": "hat", "b": "pan", "count": 363 }
-{ "a": "eks", "b": "zee", "count": 357 }
+a=zee,b=wye,count=455
+a=pan,b=eks,count=429
+a=pan,b=pan,count=427
+a=wye,b=hat,count=426
+a=hat,b=wye,count=423
+a=pan,b=hat,count=417
+a=eks,b=hat,count=417
+a=eks,b=eks,count=413
+a=pan,b=zee,count=413
+a=zee,b=hat,count=409
+a=eks,b=wye,count=407
+a=zee,b=zee,count=403
+a=pan,b=wye,count=395
+a=wye,b=pan,count=392
+a=zee,b=eks,count=391
+a=zee,b=pan,count=389
+a=hat,b=eks,count=389
+a=wye,b=eks,count=386
+a=hat,b=zee,count=385
+a=wye,b=zee,count=385
+a=hat,b=hat,count=381
+a=wye,b=wye,count=377
+a=eks,b=pan,count=371
+a=hat,b=pan,count=363
+a=eks,b=zee,count=357
 

@@ -728,16 +728,16 @@ $ mlr count-distinct -f a,b then sort -nr count data/medium

 $ mlr count-distinct -u -f a,b data/medium
-{ "field": "a", "value": "pan", "count": 2081 }
-{ "field": "a", "value": "eks", "count": 1965 }
-{ "field": "a", "value": "wye", "count": 1966 }
-{ "field": "a", "value": "zee", "count": 2047 }
-{ "field": "a", "value": "hat", "count": 1941 }
-{ "field": "b", "value": "pan", "count": 1942 }
-{ "field": "b", "value": "wye", "count": 2057 }
-{ "field": "b", "value": "zee", "count": 1943 }
-{ "field": "b", "value": "eks", "count": 2008 }
-{ "field": "b", "value": "hat", "count": 2050 }
+field=a,value=pan,count=2081
+field=a,value=eks,count=1965
+field=a,value=wye,count=1966
+field=a,value=zee,count=2047
+field=a,value=hat,count=1941
+field=b,value=pan,count=1942
+field=b,value=wye,count=2057
+field=b,value=zee,count=1943
+field=b,value=eks,count=2008
+field=b,value=hat,count=2050
 

@@ -746,31 +746,31 @@ $ mlr count-distinct -u -f a,b data/medium

 $ mlr count-distinct -f a,b -o someothername then sort -nr someothername data/medium
-{ "a": "zee", "b": "wye", "someothername": 455 }
-{ "a": "pan", "b": "eks", "someothername": 429 }
-{ "a": "pan", "b": "pan", "someothername": 427 }
-{ "a": "wye", "b": "hat", "someothername": 426 }
-{ "a": "hat", "b": "wye", "someothername": 423 }
-{ "a": "pan", "b": "hat", "someothername": 417 }
-{ "a": "eks", "b": "hat", "someothername": 417 }
-{ "a": "eks", "b": "eks", "someothername": 413 }
-{ "a": "pan", "b": "zee", "someothername": 413 }
-{ "a": "zee", "b": "hat", "someothername": 409 }
-{ "a": "eks", "b": "wye", "someothername": 407 }
-{ "a": "zee", "b": "zee", "someothername": 403 }
-{ "a": "pan", "b": "wye", "someothername": 395 }
-{ "a": "wye", "b": "pan", "someothername": 392 }
-{ "a": "zee", "b": "eks", "someothername": 391 }
-{ "a": "zee", "b": "pan", "someothername": 389 }
-{ "a": "hat", "b": "eks", "someothername": 389 }
-{ "a": "wye", "b": "eks", "someothername": 386 }
-{ "a": "hat", "b": "zee", "someothername": 385 }
-{ "a": "wye", "b": "zee", "someothername": 385 }
-{ "a": "hat", "b": "hat", "someothername": 381 }
-{ "a": "wye", "b": "wye", "someothername": 377 }
-{ "a": "eks", "b": "pan", "someothername": 371 }
-{ "a": "hat", "b": "pan", "someothername": 363 }
-{ "a": "eks", "b": "zee", "someothername": 357 }
+a=zee,b=wye,someothername=455
+a=pan,b=eks,someothername=429
+a=pan,b=pan,someothername=427
+a=wye,b=hat,someothername=426
+a=hat,b=wye,someothername=423
+a=pan,b=hat,someothername=417
+a=eks,b=hat,someothername=417
+a=eks,b=eks,someothername=413
+a=pan,b=zee,someothername=413
+a=zee,b=hat,someothername=409
+a=eks,b=wye,someothername=407
+a=zee,b=zee,someothername=403
+a=pan,b=wye,someothername=395
+a=wye,b=pan,someothername=392
+a=zee,b=eks,someothername=391
+a=zee,b=pan,someothername=389
+a=hat,b=eks,someothername=389
+a=wye,b=eks,someothername=386
+a=hat,b=zee,someothername=385
+a=wye,b=zee,someothername=385
+a=hat,b=hat,someothername=381
+a=wye,b=wye,someothername=377
+a=eks,b=pan,someothername=371
+a=hat,b=pan,someothername=363
+a=eks,b=zee,someothername=357
 

@@ -779,7 +779,7 @@ $ mlr count-distinct -f a,b -o someothername then sort -nr someothername data/me

 $ mlr count-distinct -n -f a,b data/medium
-{ "count": 25 }
+count=25
 

@@ -954,7 +954,7 @@ i x y

 $ echo 'a=1,b=2,c=3' | mlr cut -f b,c,a
-{ "a": 1, "b": 2, "c": 3 }
+a=1,b=2,c=3
 

@@ -963,7 +963,7 @@ $ echo 'a=1,b=2,c=3' | mlr cut -f b,c,a

 $ echo 'a=1,b=2,c=3' | mlr cut -o -f b,c,a
-{ "b": 2, "c": 3, "a": 1 }
+b=2,c=3,a=1
 

@@ -1560,11 +1560,11 @@ preparation for CSV or pretty-print output.

 $ mlr cat data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true }
-{ "record_count": 100, "resource": "/path/to/file" }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true }
-{ "record_count": 150, "resource": "/path/to/second/file" }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false }
+resource=/path/to/file,loadsec=0.45,ok=true
+record_count=100,resource=/path/to/file
+resource=/path/to/second/file,loadsec=0.32,ok=true
+record_count=150,resource=/path/to/second/file
+resource=/some/other/path,loadsec=0.97,ok=false
 

@@ -1621,11 +1621,11 @@ Examples:

 $ mlr cat data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true }
-{ "record_count": 100, "resource": "/path/to/file" }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true }
-{ "record_count": 150, "resource": "/path/to/second/file" }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false }
+resource=/path/to/file,loadsec=0.45,ok=true
+record_count=100,resource=/path/to/file
+resource=/path/to/second/file,loadsec=0.32,ok=true
+record_count=150,resource=/path/to/second/file
+resource=/some/other/path,loadsec=0.97,ok=false
 

@@ -1634,11 +1634,11 @@ $ mlr cat data/het.dkvp

 $ mlr having-fields --at-least resource data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true }
-{ "record_count": 100, "resource": "/path/to/file" }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true }
-{ "record_count": 150, "resource": "/path/to/second/file" }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false }
+resource=/path/to/file,loadsec=0.45,ok=true
+record_count=100,resource=/path/to/file
+resource=/path/to/second/file,loadsec=0.32,ok=true
+record_count=150,resource=/path/to/second/file
+resource=/some/other/path,loadsec=0.97,ok=false
 

@@ -1647,9 +1647,9 @@ $ mlr having-fields --at-least resource data/het.dkvp

 $ mlr having-fields --which-are resource,ok,loadsec data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false }
+resource=/path/to/file,loadsec=0.45,ok=true
+resource=/path/to/second/file,loadsec=0.32,ok=true
+resource=/some/other/path,loadsec=0.97,ok=false
 

@@ -2697,11 +2697,11 @@ a=wCOLUMN5e,b=pan,i=5,x=0.5732889198020006,COLUMN5=0.8636244699032729

 $ mlr rename y,COLUMN5 data/small
-{ "a": "pan", "b": "pan", "i": 1, "x": 0.3467901443380824, "COLUMN5": 0.7268028627434533 }
-{ "a": "eks", "b": "pan", "i": 2, "x": 0.7586799647899636, "COLUMN5": 0.5221511083334797 }
-{ "a": "wye", "b": "wye", "i": 3, "x": 0.20460330576630303, "COLUMN5": 0.33831852551664776 }
-{ "a": "eks", "b": "wye", "i": 4, "x": 0.38139939387114097, "COLUMN5": 0.13418874328430463 }
-{ "a": "wye", "b": "pan", "i": 5, "x": 0.5732889198020006, "COLUMN5": 0.8636244699032729 }
+a=pan,b=pan,i=1,x=0.3467901443380824,COLUMN5=0.7268028627434533
+a=eks,b=pan,i=2,x=0.7586799647899636,COLUMN5=0.5221511083334797
+a=wye,b=wye,i=3,x=0.20460330576630303,COLUMN5=0.33831852551664776
+a=eks,b=wye,i=4,x=0.38139939387114097,COLUMN5=0.13418874328430463
+a=wye,b=pan,i=5,x=0.5732889198020006,COLUMN5=0.8636244699032729
 

@@ -2835,18 +2835,18 @@ color=green,count=3

 $ mlr repeat -f count then cut -x -f count data/repeat-example.dat
-{ "color": "blue" }
-{ "color": "blue" }
-{ "color": "blue" }
-{ "color": "blue" }
-{ "color": "blue" }
-{ "color": "red" }
-{ "color": "red" }
-{ "color": "red" }
-{ "color": "red" }
-{ "color": "green" }
-{ "color": "green" }
-{ "color": "green" }
+color=blue
+color=blue
+color=blue
+color=blue
+color=blue
+color=red
+color=red
+color=red
+color=red
+color=green
+color=green
+color=green
 

@@ -3076,16 +3076,16 @@ unless start == stop.

 $ mlr seqgen --stop 10
-{ "i": 1 }
-{ "i": 2 }
-{ "i": 3 }
-{ "i": 4 }
-{ "i": 5 }
-{ "i": 6 }
-{ "i": 7 }
-{ "i": 8 }
-{ "i": 9 }
-{ "i": 10 }
+i=1
+i=2
+i=3
+i=4
+i=5
+i=6
+i=7
+i=8
+i=9
+i=10
 

@@ -3093,12 +3093,12 @@ $ mlr seqgen --stop 10

 $ mlr seqgen --start 20 --stop 40 --step 4
-{ "i": 20 }
-{ "i": 24 }
-{ "i": 28 }
-{ "i": 32 }
-{ "i": 36 }
-{ "i": 40 }
+i=20
+i=24
+i=28
+i=32
+i=36
+i=40
 

@@ -3106,12 +3106,12 @@ $ mlr seqgen --start 20 --stop 40 --step 4

 $ mlr seqgen --start 40 --stop 20 --step -4
-{ "i": 40 }
-{ "i": 36 }
-{ "i": 32 }
-{ "i": 28 }
-{ "i": 24 }
-{ "i": 20 }
+i=40
+i=36
+i=32
+i=28
+i=24
+i=20
 

@@ -3283,10 +3283,10 @@ were encountered, regardless of the specified sort order:

 $ mlr sort -n  x data/sort-missing.dkvp
-{ "x": 1 }
-{ "x": 2 }
-{ "x": 4 }
-{ "a": 3 }
+x=1
+x=2
+x=4
+a=3
 

@@ -3294,10 +3294,10 @@ $ mlr sort -n x data/sort-missing.dkvp

 $ mlr sort -nr x data/sort-missing.dkvp
-{ "x": 4 }
-{ "x": 2 }
-{ "x": 1 }
-{ "a": 3 }
+x=4
+x=2
+x=1
+a=3
 

@@ -4056,24 +4056,24 @@ $ wc -l data/colored-shapes.dkvp

 $ mlr uniq -g color,shape data/colored-shapes.dkvp
-{ "color": "yellow", "shape": "triangle" }
-{ "color": "red", "shape": "square" }
-{ "color": "red", "shape": "circle" }
-{ "color": "purple", "shape": "triangle" }
-{ "color": "yellow", "shape": "circle" }
-{ "color": "purple", "shape": "square" }
-{ "color": "yellow", "shape": "square" }
-{ "color": "red", "shape": "triangle" }
-{ "color": "green", "shape": "triangle" }
-{ "color": "green", "shape": "square" }
-{ "color": "blue", "shape": "circle" }
-{ "color": "blue", "shape": "triangle" }
-{ "color": "purple", "shape": "circle" }
-{ "color": "blue", "shape": "square" }
-{ "color": "green", "shape": "circle" }
-{ "color": "orange", "shape": "triangle" }
-{ "color": "orange", "shape": "square" }
-{ "color": "orange", "shape": "circle" }
+color=yellow,shape=triangle
+color=red,shape=square
+color=red,shape=circle
+color=purple,shape=triangle
+color=yellow,shape=circle
+color=purple,shape=square
+color=yellow,shape=square
+color=red,shape=triangle
+color=green,shape=triangle
+color=green,shape=square
+color=blue,shape=circle
+color=blue,shape=triangle
+color=purple,shape=circle
+color=blue,shape=square
+color=green,shape=circle
+color=orange,shape=triangle
+color=orange,shape=square
+color=orange,shape=circle
 

diff --git a/doc/reference.html b/doc/reference.html index 2531ca24f..81074565f 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -398,7 +398,7 @@ something else, particularly CSV. I use Miller’s pretty-print format

 $ echo 'x=3.1,y=4.3' | mlr put '$z=fmtnum($x*$y,"%08lf")'
-{ "x": 3.1, "y": 4.3, "z": 13.330000 }
+x=3.1,y=4.3,z=13.330000
 

@@ -406,7 +406,7 @@ $ echo 'x=3.1,y=4.3' | mlr put '$z=fmtnum($x*$y,"%08lf")'

 $ echo 'x=0xffff,y=0xff' | mlr put '$z=fmtnum(int($x*$y),"%08llx")'
-{ "x": 0xffff, "y": 0xff, "z": "00feff01" }
+x=0xffff,y=0xff,z=00feff01
 

@@ -421,7 +421,7 @@ Example:

 $ echo 'x=0xffff,y=0xff' | mlr put '$z=hexfmt($x*$y)'
-{ "x": 0xffff, "y": 0xff, "z": 0xfeff01 }
+x=0xffff,y=0xff,z=0xfeff01
 

@@ -761,11 +761,11 @@ all sort-field values present:

 $ mlr cat data/sort-null.dat
-{ "a": 3, "b": 2 }
-{ "a": 1, "b": 8 }
-{ "a": "", "b": 4 }
-{ "x": 9, "b": 10 }
-{ "a": 5, "b": 7 }
+a=3,b=2
+a=1,b=8
+a=,b=4
+x=9,b=10
+a=5,b=7
 

@@ -773,11 +773,11 @@ $ mlr cat data/sort-null.dat

 $ mlr sort -n  a data/sort-null.dat
-{ "a": 1, "b": 8 }
-{ "a": 3, "b": 2 }
-{ "a": 5, "b": 7 }
-{ "a": "", "b": 4 }
-{ "x": 9, "b": 10 }
+a=1,b=8
+a=3,b=2
+a=5,b=7
+a=,b=4
+x=9,b=10
 

@@ -785,11 +785,11 @@ $ mlr sort -n a data/sort-null.dat

 $ mlr sort -nr a data/sort-null.dat
-{ "a": "", "b": 4 }
-{ "a": 5, "b": 7 }
-{ "a": 3, "b": 2 }
-{ "a": 1, "b": 8 }
-{ "x": 9, "b": 10 }
+a=,b=4
+a=5,b=7
+a=3,b=2
+a=1,b=8
+x=9,b=10
 

@@ -799,7 +799,7 @@ $ mlr sort -nr a data/sort-null.dat

 $ echo 'x=2,y=3' | mlr put '$a=$x+$y'
-{ "x": 2, "y": 3, "a": 5 }
+x=2,y=3,a=5
 

@@ -807,7 +807,7 @@ $ echo 'x=2,y=3' | mlr put '$a=$x+$y'

 $ echo 'x=,y=3' | mlr put '$a=$x+$y'
-{ "x": "", "y": 3, "a": "" }
+x=,y=3,a=
 

@@ -815,7 +815,7 @@ $ echo 'x=,y=3' | mlr put '$a=$x+$y'

 $ echo 'x=,y=3' | mlr put '$a=log($x);$b=log($y)'
-{ "x": "", "y": 3, "a": "", "b": 1.098612 }
+x=,y=3,a=,b=1.098612
 

@@ -826,7 +826,7 @@ special: if one argument is non-null, it wins:

 $ echo 'x=,y=3' | mlr put '$a=min($x,$y);$b=max($x,$y)'
-{ "x": "", "y": 3, "a": 3, "b": 3 }
+x=,y=3,a=3,b=3
 

@@ -843,7 +843,7 @@ absent is not stored in the left-hand side of an assignment statement :

 $ echo 'x=2,y=3' | mlr put '$a=$u+$v; $b=$u+$y; $c=$x+$y'
-{ "x": 2, "y": 3, "b": 3, "c": 5 }
+x=2,y=3,b=3,c=5
 

@@ -851,7 +851,7 @@ $ echo 'x=2,y=3' | mlr put '$a=$u+$v; $b=$u+$y; $c=$x+$y'

 $ echo 'x=2,y=3' | mlr put '$a=min($x,$v);$b=max($u,$y);$c=min($u,$v)'
-{ "x": 2, "y": 3, "a": 2, "b": 3 }
+x=2,y=3,a=2,b=3
 

@@ -906,11 +906,11 @@ inputs present — you can use a pattern-action block with

 $ mlr cat data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true }
-{ "record_count": 100, "resource": "/path/to/file" }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true }
-{ "record_count": 150, "resource": "/path/to/second/file" }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false }
+resource=/path/to/file,loadsec=0.45,ok=true
+record_count=100,resource=/path/to/file
+resource=/path/to/second/file,loadsec=0.32,ok=true
+record_count=150,resource=/path/to/second/file
+resource=/some/other/path,loadsec=0.97,ok=false
 

@@ -918,11 +918,11 @@ $ mlr cat data/het.dkvp

 $ mlr put 'is_present($loadsec) { $loadmillis = $loadsec * 1000 }' data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true, "loadmillis": 450.000000 }
-{ "record_count": 100, "resource": "/path/to/file" }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true, "loadmillis": 320.000000 }
-{ "record_count": 150, "resource": "/path/to/second/file" }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false, "loadmillis": 970.000000 }
+resource=/path/to/file,loadsec=0.45,ok=true,loadmillis=450.000000
+record_count=100,resource=/path/to/file
+resource=/path/to/second/file,loadsec=0.32,ok=true,loadmillis=320.000000
+record_count=150,resource=/path/to/second/file
+resource=/some/other/path,loadsec=0.97,ok=false,loadmillis=970.000000
 

@@ -930,11 +930,11 @@ $ mlr put 'is_present($loadsec) { $loadmillis = $loadsec * 1000 }' data/het.dkvp

 $ mlr put '$loadmillis = (is_present($loadsec) ? $loadsec : 0.0) * 1000' data/het.dkvp
-{ "resource": "/path/to/file", "loadsec": 0.45, "ok": true, "loadmillis": 450.000000 }
-{ "record_count": 100, "resource": "/path/to/file", "loadmillis": 0.000000 }
-{ "resource": "/path/to/second/file", "loadsec": 0.32, "ok": true, "loadmillis": 320.000000 }
-{ "record_count": 150, "resource": "/path/to/second/file", "loadmillis": 0.000000 }
-{ "resource": "/some/other/path", "loadsec": 0.97, "ok": false, "loadmillis": 970.000000 }
+resource=/path/to/file,loadsec=0.45,ok=true,loadmillis=450.000000
+record_count=100,resource=/path/to/file,loadmillis=0.000000
+resource=/path/to/second/file,loadsec=0.32,ok=true,loadmillis=320.000000
+record_count=150,resource=/path/to/second/file,loadmillis=0.000000
+resource=/some/other/path,loadsec=0.97,ok=false,loadmillis=970.000000
 

@@ -1063,8 +1063,8 @@ name=bull,regex=^b[ou]ll$

 $ mlr filter '$name =~ $regex' data/regex-in-data.dat
-{ "name": "jane", "regex": "^j.*e$" }
-{ "name": "bull", "regex": "^b[ou]ll$" }
+name=jane,regex=^j.*e$
+name=bull,regex=^b[ou]ll$
 

diff --git a/doc/sample_mlrrc b/doc/sample_mlrrc new file mode 100644 index 000000000..b13d78cd6 --- /dev/null +++ b/doc/sample_mlrrc @@ -0,0 +1,17 @@ +# 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 @