Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 448

sqlite3 import csv with column and row separator

$
0
0

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 csvCREATE 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!


Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>