3 ms·
This is great. I keep the following in my bash profile for querying CSVs with SQL, which works OK, but this is probably better: function csv_to_sqlite() {
by mjirv 7y ago
This is great. I keep the following in my bash profile for querying CSVs with SQL, which works OK, but this is probably better:
function csv_to_sqlite() {
echo "used as csv_to_sqlite PATH_TO_CSV TABLE_NAME"
sqlite3 -csv -cmd ".import $1 $2" -cmd ".headers on"
}
Two suggestions:
1. It would be a lot more useful if I could link an entire database rather than just tables
2. Sometimes I just want to query a single CSV, so a command line argument where I can just specify the path would be nice
- cube2222 7y agoThanks! 1. Initially we wanted to do one table per config-entry, but that'll be an easy to do UX improvement. 2. We're planning to add support for piping the csv/json file through stdin! That would be the most seamless workflow I think.