SQL-like query language for csv

External Command

You can run an external command by placing a Dollar Sign(U+0024 $) at the beggining of the line. The result is written to the standard output.

CALL Function also runs an external command, but the result is returned as a string.

$ command [args ...]

Arguments are separated with spaces. Strings including spaces are treated as a single string by enclosing in Apostrophes(U+0027 ') or Quotation Marks(U+0022 "). Embedded expressions including spaces are also treated as chunks.

In the arguments, following expressions can be embedded.

Embedded Expression


Expressions can be embedded in arguments by enclosing in a Dollar Sign(U+0024 $) and Curly Brackets(U+007B, U+007D {}). The result of evaluation of the expression must be a single value.


csvq > $echo 'abc'
csvq > VAR @ARG := 'argstr'
csvq > $echo @ARG
csvq > $echo @%HOME
csvq > $echo ${@%HOME || '/docs'}
csvq > $sh -c 'echo ${@%HOME || "/docs"} | wc'
      1       1      22
csvq >