How do I import non-CSV ASCII data into SQLite 3?
I have a large amount of newline (0x0A)-terminated ASCII data that I want to import to SQLite 3. I can't use CSV format, because many of the text fields have embedded commas and quotes. I can reformat the data any which way, but I'd rather not reformat as SQL insert statements (over 400 million rows).
I want the use the ".import" command, which supposedly supports an "ascii" format where a column separator of 0x1F and row separator of 0x1E is used. Somehow, it doesn't work. I keep getting "Expected 120 columns but found 1".
All the Google results that I'm getting are about CSV import, which is why I'm asking here.
I'm including a simplified example of my problem below. As mentioned, the sample data can contain quotes (single and double), tabs and commas, so I can't use those as delimiters. I can use any other byte value for column and row delimiters.
Example.
Table
create table testtable ( item char(20), descr char(30), misc char(40) );
Data
| item | descr | misc |
|---|---|---|
| apple | a fruit | no "other" comments, for now |
| grape | another fruit | Yes, I like grapes |