textql Command Examples

Execute SQL against structured text like CSV or TSV files. More information: https://github.com/dinedal/textql.

textql -sql "{{SELECT * FROM filename}}" {{path/to/filename.csv}}

textql -dlm=tab -sql "{{SELECT * FROM filename}}" {{path/to/filename.tsv}}

textql -dlm={{delimiter}} -header -sql "{{SELECT * FROM filename}}" {{path/to/filename.csv}}

cat {{path/to/file}} | textql -sql "{{SELECT * FROM stdin}}"

textql -header -sql "SELECT * FROM {{path/to/file1}} JOIN {{file2}} ON {{path/to/file1}}.{{c1}} = {{file2}}.{{c1}} LIMIT {{10}}" -output-header {{path/to/file1.csv}} {{path/to/file2.csv}}

textql -output-dlm={{delimiter}} -output-header -sql "SELECT {{column}} AS {{alias}} FROM {{filename}}" {{path/to/filename.csv}}