Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 1.81 KB

foreach.md

File metadata and controls

39 lines (33 loc) · 1.81 KB

xan foreach

The foreach command evaluates an expression for each row of the given CSV file
but does not output anything except printing errors. Use the "map" command
instead if you want to keep results. "foreach" should only be used when
performing side-effects (writing files, copying files etc.).

For a quick review of the capabilities of the expression language,
check out the `xan help cheatsheet` command.

For a list of available functions, use `xan help functions`.

Usage:
    xan foreach [options] <expression> [<input>]
    xan foreach --help

foreach options:
    -p, --parallel             Whether to use parallelization to speed up computations.
                               Will automatically select a suitable number of threads to use
                               based on your number of cores. Use -t, --threads if you want to
                               indicate the number of threads yourself.
    -t, --threads <threads>    Parellize computations using this many threads. Use -p, --parallel
                               if you want the number of threads to be automatically chosen instead.
    -E, --errors <policy>      What to do with evaluation errors. One of:
                                 - "panic": exit on first error
                                 - "ignore": coerce result for row to null
                                 - "log": print error to stderr
                               [default: panic].

Common options:
    -h, --help               Display this message
    -o, --output <file>      Write output to <file> instead of stdout.
    -n, --no-headers         When set, the first row will not be evaled
                             as headers.
    -d, --delimiter <arg>    The field delimiter for reading CSV data.
                             Must be a single character.