I'm importing several CSV files into a single table. The documentation for CSV import says
when the table already exists, every row of the CSV file, including the first row, is assumed to be actual content. If the CSV file contains an initial row of column labels, you can cause the .import command to skip that initial row using the "--skip 1" option.
But I can't seem to figure out a valid way to pass that flag. I tried the following:
sqlite> .import foo.csv contributions --skip 1
Usage: .import FILE TABLE
sqlite> .import --skip 1 foo.csv contributions
Usage: .import FILE TABLE
sqlite> .import foo.csv --skip 1 contributions
Usage: .import FILE TABLE
I'm using version 3.30.1.
tail -n+2
or sed. I feel like the documentation could do a better job of calling this out, what versions which features got added. Some of the systems I work with have quite old versions of SQLite, so it's a too-common occurrence to find out "oh, I guess I can't use that." – Hangchow