SQLite3 Import CSV & exclude/skip header

This worked for me:

.read schema.sql
.mode csv
.import --skip 1 artist_t.csv artist_t

or if you just have one file to import, you can do it like this:

.import --csv --skip 1 artist_t.csv artist_t

https://sqlite.org/cli.html#importing_csv_files


A alternative response to @steven-penny

You can also use a bash command during sqlite import

.mode csv
.import '| tail -n +2 artist_t.csv' artist_t

patid is a column name.
"patid" is a quoted column name.
'patid' is a string.

The condition WHERE patid = "patid" compares the value in the patid column with itself.

(SQLite allows strings with double quotes for compatibility with MySQL, but only where a string cannot be confused with a table/column name.)

Tags:

Csv

Sqlite

Import