SQLite Forum

Issue importing csv file to db
Login
With a few minutes to spare, I downloaded your large text file.  It is indeed using '\|' as field separators, so it is very strange to be treating it as CSV.

Another issue is that the lines have 15 separators, which almost matches the 15 columns you define for table SUNAT.  But the match is poor because 15 separators are needed for 16 fields.  The import is very slow and noisy because of all the yapping about ignoring an extra field per record.

Another issue, perhaps explaining your disappointment, is that a great many lines, during the .import, produce an error to stderr such as: "adron_reducido_ruc.txt:13718893: unescaped " character". I think these are not accepted because they are invalid CSV.

I would recommend that you get these problems sorted out while testing with a few hundred lines of that file, perhaps including line 13718893. Do that in an interactive sqlite3 shell session so that you have a chance to catch errors rather than having them zip by in a flash or get swallowed. Once you have that working, your humongous .import may act more as you hoped.