diff --git a/README.md b/README.md index 6d89185b9..6a265eac4 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ indices. Examples: $mean = $sum / $count # no assignment if count unset ' % mlr --from infile.dat put -f analyze.mlr +% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' +% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' +% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' ``` This is something the Unix toolkit always could have done, and arguably always diff --git a/c/cli/mlrcli.c b/c/cli/mlrcli.c index 1683ae7e4..2ff3866ba 100644 --- a/c/cli/mlrcli.c +++ b/c/cli/mlrcli.c @@ -248,6 +248,10 @@ static void main_usage_examples(FILE* o, char* argv0, char* leader) { fprintf(o, " }\n"); fprintf(o, " $mean = $sum / $count # no assignment if count unset'\n"); fprintf(o, "%s%s --from infile.dat put -f analyze.mlr\n", leader, argv0); + fprintf(o, "%s%s --from infile.dat put 'tee > \"./taps/data-\".$a.\"-\".$b, $*'\n", leader, argv0); + fprintf(o, "%s%s --from infile.dat put -q '@v=$*; dump | \"jq .[]\"'\n", leader, argv0); + fprintf(o, "%s%s --from infile.dat put '(NR %% 1000 == 0) { print > stderr, \"Checkpoint \".NR}'\n", + leader, argv0); } static void list_all_verbs_raw(FILE* o) { diff --git a/c/todo.txt b/c/todo.txt index 99692c832..b1bcda9ab 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -31,8 +31,6 @@ COMMON: * mlr -k | grep mlr | sed 's/Example: //' | sh 1>1 2>2 ! flesh out ...'s in mlr -k's -* some >/>>/| at cover x 3 - * lrec_reader factor take popts as well ~ lrec_reader/writer take sub-bagged cliopts pstructs ~ put/tee --oxxx flags overlays, w/ substruct data & federated substruct fcns diff --git a/doc/index-snippet.txt b/doc/index-snippet.txt index f36565942..5a8fb06a6 100644 --- a/doc/index-snippet.txt +++ b/doc/index-snippet.txt @@ -16,3 +16,6 @@ $mean = $sum / $count # no assignment if count unset ' % mlr --from infile.dat put -f analyze.mlr +% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' +% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' +% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' diff --git a/doc/index.html b/doc/index.html index 3068a23a7..858b61e98 100644 --- a/doc/index.html +++ b/doc/index.html @@ -169,6 +169,9 @@ positional indices. For example: $mean = $sum / $count # no assignment if count unset ' % mlr --from infile.dat put -f analyze.mlr +% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' +% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' +% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'
diff --git a/doc/manpage.html b/doc/manpage.html index e04d3d101..92a161923 100644 --- a/doc/manpage.html +++ b/doc/manpage.html @@ -185,6 +185,9 @@ EXAMPLES } $mean = $sum / $count # no assignment if count unset' mlr --from infile.dat put -f analyze.mlr + mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' + mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' + mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' DATA FORMATS DKVP: delimited key-value pairs (Miller default format) diff --git a/doc/manpage.txt b/doc/manpage.txt index d8936109b..58800e411 100644 --- a/doc/manpage.txt +++ b/doc/manpage.txt @@ -39,6 +39,9 @@ EXAMPLES } $mean = $sum / $count # no assignment if count unset' mlr --from infile.dat put -f analyze.mlr + mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' + mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' + mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' DATA FORMATS DKVP: delimited key-value pairs (Miller default format) diff --git a/doc/mlr.1 b/doc/mlr.1 index 779edfba3..da686034b 100644 --- a/doc/mlr.1 +++ b/doc/mlr.1 @@ -64,6 +64,9 @@ mlr --from estimates.tbl put ' } $mean = $sum / $count # no assignment if count unset' mlr --from infile.dat put -f analyze.mlr +mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' +mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' +mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' .fi .if n \{\ .RE diff --git a/doc/reference.html b/doc/reference.html index 24f2fb629..51e187ddd 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -336,6 +336,9 @@ Command-line-syntax examples: } $mean = $sum / $count # no assignment if count unset' mlr --from infile.dat put -f analyze.mlr + mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*' + mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"' + mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}' Data-format examples: DKVP: delimited key-value pairs (Miller default format)