No (real) need for a script, you can import in the sqlite3 commandline. First make the table, then set a .separator, then .import the file. I am not sure how performant it is though, so creating transactions outside might be better in some cases.
Re:Command-line tools for data science
by mkiwala on Thursday September 19, 2013 @03:40PM
(#6413757)
The sqlite3 .import command does not handle quoted csv values.
"Doe, John", 1234 Pine St, Springfield
That would be imported as 4 fields, not 3.
Used to be true. But recent versions of SQLite fix this.
Re:Command-line tools for data science
by dergachev on Friday September 20, 2013 @09:43AM
(#6417630)
csv2sqlite actually generates the table definitions for you, so I think that's a big improvement when you just downloaded a CSV file with 30 columns in it and need to quickly verify it or extract some data from it.
Also supports parsing multiple CSV files at once, so you can easily do joins.
I wrote a quick ruby script that converts one or more CSV files into an SQLITE db file, so you can easily query them.
https://github.com/dergachev/csv2sqlite