All,

I have to import text files into an SQLite table.
The txt files are plain text in UTF-8. They don't contain tabs and the line
ending is CRLF.

One line in the TXT should become one record in the table.

CREATE TABLE Source (Segments);
.import 'test.txt <http://www.datamundi.be/test.txt>' Source
SELECT count(*) FROM Source;

The source text contains 156659 lines but the imported table contains only
65561 records.

I tried several mode settings and separator settings, but the result is
always the same.
Unless my separator is a '|' or when I don't define it, I get an error
message because some lines contain this character.
If I define '\t' (tab) as a separator, I don't get an error message but the
import is not correct.

When I analyse the strange behavior, I notice 2 things:
- the import is not done line per line (even when the mode is "line")
- the last line in the last record, is not the last line of imported txt
file.

The text files I need to import can be quite large (50MB) but it also
happens with smaller files (10MB and 150.000 lines).

Does anyone see something obvious I'm doing wrong?
I'm using SQLite 3.7.15.2

thank you all for your help.

gert
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to