mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-20 01:46:26 +00:00
env-var doc
This commit is contained in:
parent
770377b121
commit
6c7eebc6dc
8 changed files with 21 additions and 13 deletions
|
|
@ -45,7 +45,8 @@ static void mapper_filter_usage(FILE* o, char* argv0, char* verb) {
|
|||
fprintf(o, "Please use a dollar sign for field names and double-quotes for string\n");
|
||||
fprintf(o, "literals. If field names have special characters such as \".\" then you might\n");
|
||||
fprintf(o, "use braces, e.g. '${field.name}'. Miller built-in variables are\n");
|
||||
fprintf(o, "NF NR FNR FILENUM FILENAME PI E.\n");
|
||||
fprintf(o, "NF NR FNR FILENUM FILENAME PI E, and ENV[\"namegoeshere\"] to access environment\n");
|
||||
fprintf(o, "variables; the environment-variable name may be an expression, e.g. a field value.\n");
|
||||
fprintf(o, "\n");
|
||||
fprintf(o, "Examples:\n");
|
||||
fprintf(o, " %s %s 'log10($count) > 4.0'\n", argv0, verb);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ static void mapper_put_usage(FILE* o, char* argv0, char* verb) {
|
|||
fprintf(o, "Please use a dollar sign for field names and double-quotes for string\n");
|
||||
fprintf(o, "literals. If field names have special characters such as \".\" then you might\n");
|
||||
fprintf(o, "use braces, e.g. '${field.name}'. Miller built-in variables are\n");
|
||||
fprintf(o, "NF NR FNR FILENUM FILENAME PI E.\n");
|
||||
fprintf(o, "NF NR FNR FILENUM FILENAME PI E, and ENV[\"namegoeshere\"] to access environment\n");
|
||||
fprintf(o, "variables; the environment-variable name may be an expression, e.g. a field value.\n");
|
||||
fprintf(o, "\n");
|
||||
fprintf(o, "Examples:\n");
|
||||
fprintf(o, " Assignment only:\n");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ BUGFIXES
|
|||
TOP-OF-LIST SUMMARY
|
||||
|
||||
* JSON input: UT/doc items
|
||||
* env vars: UT; OLH ~ PI/E/etc.
|
||||
* env vars: OLH ~ PI/E/etc.
|
||||
|
||||
! rh/fedora/centos mlr-3.3.2: after patch-file for manpage
|
||||
? make a 3.3.3 w/ all but oosvar/begin-end/pattern-action? what to do about filter/gate which is transitional?
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ put '$xy = $x * $y'</tt> or <tt>mlr put '$counter = NR'</tt>.
|
|||
<li/> The <tt>$name</tt> syntax is straight from <tt>awk</tt>’s <tt>$1 $2
|
||||
$3</tt> (adapted to name-based indexing), as are the variables <tt>FS</tt>,
|
||||
<tt>OFS</tt>, <tt>RS</tt>, <tt>ORS</tt>, <tt>NF</tt>, <tt>NR</tt>, and
|
||||
<tt>FILENAME</tt>.
|
||||
<tt>FILENAME</tt>. The <tt>ENV[...]</tt> syntax is from Ruby.
|
||||
|
||||
<li/> While <tt>awk</tt> functions are record-based, Miller subcommands (or
|
||||
functions, if you like) are stream-based: each of them maps a stream of records
|
||||
|
|
|
|||
|
|
@ -456,7 +456,8 @@ as <tt>.</tt> then you can use braces, e.g. <tt>'${field.name}'</tt>.
|
|||
<p/>The <tt>filter</tt> command supports the same built-in variables as for <a
|
||||
href="#put"><tt>put</tt></a>, all <tt>awk</tt>-inspired: <tt>NF</tt>,
|
||||
<tt>NR</tt>, <tt>FNR</tt>, <tt>FILENUM</tt>, and <tt>FILENAME</tt>, as well as
|
||||
the mathematical constants <tt>PI</tt> and <tt>E</tt>. This selects the 2nd
|
||||
the mathematical constants <tt>PI</tt> and <tt>E</tt>.
|
||||
This selects the 2nd
|
||||
record from each matching file:
|
||||
|
||||
POKI_RUN_COMMAND{{mlr filter 'FNR == 2' data/small*}}HERE
|
||||
|
|
@ -669,7 +670,7 @@ have special characters such as <tt>.</tt> then you can use braces, e.g.
|
|||
href="#filter"><tt>filter</tt></a> and <tt>put</tt>, all <tt>awk</tt>-inspired:
|
||||
<tt>NF</tt>, <tt>NR</tt>, <tt>FNR</tt>, <tt>FILENUM</tt>, and
|
||||
<tt>FILENAME</tt>, as well as the mathematical constants <tt>PI</tt> and
|
||||
<tt>E</tt>.
|
||||
<tt>E</tt>. The <tt>ENV[...]</tt> syntax is from Ruby.
|
||||
|
||||
<h3>Expression formatting for put</h3>
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ put '$xy = $x * $y'</tt> or <tt>mlr put '$counter = NR'</tt>.
|
|||
<li/> The <tt>$name</tt> syntax is straight from <tt>awk</tt>’s <tt>$1 $2
|
||||
$3</tt> (adapted to name-based indexing), as are the variables <tt>FS</tt>,
|
||||
<tt>OFS</tt>, <tt>RS</tt>, <tt>ORS</tt>, <tt>NF</tt>, <tt>NR</tt>, and
|
||||
<tt>FILENAME</tt>.
|
||||
<tt>FILENAME</tt>. The <tt>ENV[...]</tt> syntax is from Ruby.
|
||||
|
||||
<li/> While <tt>awk</tt> functions are record-based, Miller subcommands (or
|
||||
functions, if you like) are stream-based: each of them maps a stream of records
|
||||
|
|
|
|||
|
|
@ -471,7 +471,8 @@ Options:
|
|||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E.
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables; the environment-variable name may be an expression, e.g. a field value.
|
||||
|
||||
Examples:
|
||||
mlr filter 'log10($count) > 4.0'
|
||||
|
|
@ -713,7 +714,8 @@ Options:
|
|||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E.
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables; the environment-variable name may be an expression, e.g. a field value.
|
||||
|
||||
Examples:
|
||||
Assignment only:
|
||||
|
|
|
|||
|
|
@ -1291,7 +1291,8 @@ Options:
|
|||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E.
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables; the environment-variable name may be an expression, e.g. a field value.
|
||||
|
||||
Examples:
|
||||
mlr filter 'log10($count) > 4.0'
|
||||
|
|
@ -1324,7 +1325,8 @@ as <tt>.</tt> then you can use braces, e.g. <tt>'${field.name}'</tt>.
|
|||
<p/>The <tt>filter</tt> command supports the same built-in variables as for <a
|
||||
href="#put"><tt>put</tt></a>, all <tt>awk</tt>-inspired: <tt>NF</tt>,
|
||||
<tt>NR</tt>, <tt>FNR</tt>, <tt>FILENUM</tt>, and <tt>FILENAME</tt>, as well as
|
||||
the mathematical constants <tt>PI</tt> and <tt>E</tt>. This selects the 2nd
|
||||
the mathematical constants <tt>PI</tt> and <tt>E</tt>.
|
||||
This selects the 2nd
|
||||
record from each matching file:
|
||||
|
||||
<p/>
|
||||
|
|
@ -2112,7 +2114,8 @@ Options:
|
|||
Please use a dollar sign for field names and double-quotes for string
|
||||
literals. If field names have special characters such as "." then you might
|
||||
use braces, e.g. '${field.name}'. Miller built-in variables are
|
||||
NF NR FNR FILENUM FILENAME PI E.
|
||||
NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment
|
||||
variables; the environment-variable name may be an expression, e.g. a field value.
|
||||
|
||||
Examples:
|
||||
Assignment only:
|
||||
|
|
@ -2150,7 +2153,7 @@ have special characters such as <tt>.</tt> then you can use braces, e.g.
|
|||
href="#filter"><tt>filter</tt></a> and <tt>put</tt>, all <tt>awk</tt>-inspired:
|
||||
<tt>NF</tt>, <tt>NR</tt>, <tt>FNR</tt>, <tt>FILENUM</tt>, and
|
||||
<tt>FILENAME</tt>, as well as the mathematical constants <tt>PI</tt> and
|
||||
<tt>E</tt>.
|
||||
<tt>E</tt>. The <tt>ENV[...]</tt> syntax is from Ruby.
|
||||
|
||||
<a id="Expression_formatting_for_put"/><h3>Expression formatting for put</h3>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue