3 ms·
Sounds a bit like a cross between the (now defunct) Google Sawzall project and the sqlite csvtable module: https://github.com/softace/sqliteodbc/blob/master/cs
by morebetterer 11y ago
Sounds a bit like a cross between the (now defunct) Google Sawzall project and the sqlite csvtable module:
https://github.com/softace/sqliteodbc/blob/master/csvtable.c https://github.com/softace/sqliteodbc/blob/master/csvtable.c
- danso 11y agoNever heard of SQlite csvtable but there is the excellent csvsql, part of the csvkit http://csvkit.readthedocs.org/en/0.9.1/scripts/csvsql.html http://csvkit.readthedocs.org/en/0.9.1/scripts/csvsql.html Here's an example of how to download the SF health inspection data, unzip it, build the SQLite schema (the dataset contains multiple tables), and then insert the CSVs into their respective tables, and query them, all from the command line. csvsql handles the inference of schema from the CSV data and the import work; the SQL commands can all obviously be done from just echoing into SQLite directly. But csv2sql will also let you create a CSV in memory and run a SQL query for those times when you just need to quickly filter the data. Here's an example: http://2015.padjo.org/tutorials/mapping/077-ok-schools-quakes/#trimming-the-schools-data http://2015.padjo.org/tutorials/mapping/077-ok-schools-quake... Tremendously useful tool. I can say without hyperbole that it has changed the scope of how I do data science, even though it literally does nothing that I could not do via SQlite and Python alone (csvkit is basically a command line wrapper written in Python around csv, SQLAlchemy, and so forth)