Execute SQL-like queries on CSV and TSV files. More information: https://harelba.github.io/q.
q -d',' "SELECT * from path/to/file"
q -t "SELECT * from path/to/file"
q -ddelimiter -H "SELECT * from path/to/file"
stdin
; ’-’ in the query represents the data from stdin
:output | q "select * from -"
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)"
q -Ddelimiter -O "SELECT column as alias from path/to/file"