Bulk load data into sqlite?

Mat Nadrofsky picture Mat Nadrofsky · Mar 30, 2009 · Viewed 25.3k times · Source

Does anybody have any tips on utilities that can be used to bulk load data that is stored in delimited text files into an SQLite database?

Ideally something that can be called as a stand-alone program from a script etc.

A group I work with has an Oracle Database that's going to dump a bunch of data out to file and then load that data into an SQLite database for use on a mobile device and are looking for the easiest way to implement that sort of scenario.

Answer

Martin Beckett picture Martin Beckett · Mar 30, 2009

Check out the sqite .import command - it does exacty this.
You can set the separator with the .separator command

sqlite3 myDatabase
create table myTable (a, b, c);
.separator ','
.import  myFile  myTable