3 ms·
Is that any different than using sqlite3 directly like this? cat data.csv | sqlite3 -csv ':memory:' '.import /dev/stdin data' 'select col1, col3 from data
by SahAssar 5y ago
Is that any different than using sqlite3 directly like this?
cat data.csv | sqlite3 -csv ':memory:' '.import /dev/stdin data' 'select col1, col3 from data where col1 != "foo"'
You can of course use the .import command directly on the file, but keeping it there to show piping.
- psanford 5y agosqlite has become my preferred way to work with csv files in an adhoc manner. I do it often enough that I wrote a small wrapper around sqlite to make it easier to work with multiple csv files with overlapping column names, and to normalize column names: https://github.com/psanford/csv2sqlite https://github.com/psanford/csv2sqlite
- anitil 5y agoUsing sqlite3 for any task makes me so happy, I try to use it even when it's overkill
- deleted 5y ago[deleted]