Import CSV to SQLite

What also is being said in the comments, SQLite sees your input as 1, 25, 62, 7. I also had a problem with , and in my case it was solved by changing “separator ,” into “.mode csv”. So you could try:

sqlite> create table foo(a, b);
sqlite> .mode csv
sqlite> .import test.csv foo

The first command creates the column names for the table. However, if you want the column names inherited from the csv file, you might just ignore the first line.

— New Versions of sqlite3 —

The latest version of sqlite3 creates the table and columns for you if you let it.

You can also skip the line “.mode csv” if you append “–csv” to the end of the import statement like so:

sqlite> .import test.csv foo --csv

Leave a Comment