
Databases
How to Use csvsql and q to Run SQL on CSV Files the Safe Way
Run SQL on CSV files from the terminal with csvsql and q, or plain sqlite3: queries, type inference traps, joins across files and output formats.
6 min read
Tag
3 posts

Run SQL on CSV files from the terminal with csvsql and q, or plain sqlite3: queries, type inference traps, joins across files and output formats.

Parse CSV and Excel files in Python to build reports: csv.DictReader, grouping totals, writing a summary, handling encodings, and reading xlsx with openpyxl.

Extract CSV columns in the shell when fields hold quoted commas: why cut fails, and how to use csvkit, Miller, awk FPAT and Python to select columns safely.