Options (5)
-d, --delimiterbooleanQuery a CSV file by specifying the delimiter as ','
Example:
q {{[-d|--delimiter]}} ',' "SELECT * from {{path/to/file}}"-t, --tab-delimitedbooleanQuery a TSV file
Example:
q {{[-t|--tab-delimited]}} "SELECT * from {{path/to/file}}"-H, --skip-headerbooleanQuery file with header row
Example:
q {{[-d|--delimiter]}} {{delimiter}} {{[-H|--skip-header]}} "SELECT * from {{path/to/file}}"-D, --output-delimiterbooleanFormat output using an output delimiter with an output header line (Note: Command will output column names based on the input file header or the column aliases overridden in the query)
Example:
q {{[-D|--output-delimiter]}} {{delimiter}} {{[-O|--output-header]}} "SELECT {{column}} as {{alias}} from {{path/to/file}}"-O, --output-headerbooleanFormat output using an output delimiter with an output header line (Note: Command will output column names based on the input file header or the column aliases overridden in the query)
Example:
q {{[-D|--output-delimiter]}} {{delimiter}} {{[-O|--output-header]}} "SELECT {{column}} as {{alias}} from {{path/to/file}}"Examples (6)
Query a CSV file by specifying the delimiter as ','
Query file with header row
Read data from `stdin`; '-' in the query represents the data from `stdin`
Join two files (aliased as `f1` and `f2` in the example) on column `c1`, a common column
q "SELECT * FROM path/to/file f1 JOIN path/to/other_file f2 ON (f1.c1 = f2.c1)"made by @shridhargupta | data from tldr-pages