Daily Shaarli

All links of one day in a single page.

June 21, 2022

One-liner for running queries against CSV files with SQLite | Simon Willison’s TILs

I figured out how to run a SQL query directly against a CSV file using the sqlite3 command-line utility:

sqlite3 :memory: -cmd '.mode csv' -cmd '.import taxi.csv taxi' \
'SELECT passenger_count, COUNT(*), AVG(total_amount) FROM taxi GROUP BY passenger_count'