Disclaimer: This page is about how to do some corner-case things in
-ways you mightn’t have thought of. For an intro, please also see
-Miller in 10 minutes.
-
Headerless CSV on input or output
@@ -23,7 +19,7 @@ ways you mightn’t have thought of. For an intro, please also see
POKI_RUN_COMMAND{{cat data/headerless.csv}}HERE
- You can use Miller to add a header: the --implicit-csv-header applies positionally indexed labels:
+ You can use Miller to add a header. The --implicit-csv-header applies positionally indexed labels:
POKI_RUN_COMMAND{{mlr --csv --implicit-csv-header cat data/headerless.csv}}HERE
POKI_RUN_COMMAND{{mlr --icsv --implicit-csv-header --opprint cat data/headerless.csv}}HERE
@@ -85,7 +81,7 @@ POKI_RUN_COMMAND{{mlr filter '$a == "wye"' then cat -n data/small}}HERE
The other is to keep your own counter within the put DSL:
-POKI_RUN_COMMAND{{mlr filter '$a == "wye"' then put 'begin {@n = 1} $n = $n; @n += 1' data/small}}HERE
+POKI_RUN_COMMAND{{mlr filter '$a == "wye"' then put 'begin {@n = 1} $n = @n; @n += 1' data/small}}HERE
The difference is a matter of taste (although mlr cat -n puts the counter first).
@@ -132,8 +128,10 @@ POKI_RUN_COMMAND_TOLERATING_ERROR{{mlr --csvlite put '$reachable = asserting_str
POKI_RUN_COMMAND{{head -n 10 data/miss-date.csv}}HERE
POKI_RUN_COMMAND{{wc -l data/miss-date.csv}}HERE
-To find these, you can convert the dates to seconds since the epoch using strptime, then
-compute adjacent differences (the cat -n simply inserts record-counters):
+Since there are 1372 lines in the data file, some automation is called for.
+To find the missing dates, you can convert the dates to seconds since the epoch
+using strptime, then compute adjacent differences (the cat -n
+simply inserts record-counters):
POKI_INCLUDE_AND_RUN_ESCAPED(data/miss-date-1.sh)HERE
diff --git a/doc/cookbook.html b/doc/cookbook.html
index 08652aefb..b6a368151 100644
--- a/doc/cookbook.html
+++ b/doc/cookbook.html
@@ -211,10 +211,6 @@ Miller commands were run with pretty-print-tabular output format.
-Disclaimer: This page is about how to do some corner-case things in
-ways you mightn’t have thought of. For an intro, please also see
-Miller in 10 minutes.
-
Headerless CSV on input or output
@@ -235,7 +231,7 @@ Carol,45,present
- You can use Miller to add a header: the --implicit-csv-header applies positionally indexed labels:
+ You can use Miller to add a header. The --implicit-csv-header applies positionally indexed labels:
-To find these, you can convert the dates to seconds since the epoch using strptime, then
-compute adjacent differences (the cat -n simply inserts record-counters):
+Since there are 1372 lines in the data file, some automation is called for.
+To find the missing dates, you can convert the dates to seconds since the epoch
+using strptime, then compute adjacent differences (the cat -n
+simply inserts record-counters):