I'm trying to load in a csv file to a table using sqlite3. (Note I am very new to using sqlite3)
The values in the rows are comma delimited and the rows are separated by new lines.
In my mind using the following in the sqlite3 shell should work:
$ sqlite3 features.db
.mode csv
CREATE TABLE csvdata ('A','B','C','D');
.headers off
.separator ROW "\n"
.separator COL ,
.import /home/DATA/testcsv csvdata
Which gives the following error:
Error: multi-character column separators not allowed for import
Perhaps this is because I'm using "\n"
for the row separator but without a row separator the script will append each comma delimited entry into one long list.
Many thanks in advance!
Edit:
The default conditions to import a csv file to SQLite is:
,
comma as column separator
\n
new line for row separator.
So even if you omit both, your code will work.
It's the column separator mentioned in the error.
Try
.separator ","