SQLite import CSV data

If you want to import a CSV file into a SQLite database it's quite simple. First create a table with the same number of columns.

CREATE TABLE Foo (Col1, Col2, Col3);

Then change the default separator to a comma and run .import against the CSV.

.separator ,
.import /tmp/foo.csv Foo
Leave A Reply
All content licensed under the Creative Commons License