If it helps I am using sqlite 3.5.9 - I have tried the following and this
works:

sqlite3 test.db
sqlite> .separator "\t"
sqlite> .import data.txt test

C.


gtxy20 wrote:
> 
> Yes it indicates line 1 - I have checked to make sure that all rows are in
> fact tab delimited and that there are no blank trailing lines in the data.
> 
> The error:
> 
> data.txt line 1: expected 2 columns of data but found 1  - keeps being
> thrown.  
> 
> I have tried both under windows and linux and the same error applies. I
> have checked the command with a number of delimiters ',', ';', '|' and
> they all work fine however it is only when I have a tab delimited file
> that i have problems with. Unfortunately I do not have control on the
> format of the text file when it arrives.
> 
> I can't help but think that the separator is not being escaped properly to
> indicate a tab - I have tried \t, \\t, "\t", '\t' but no luck.
> 
> Just getting frustrated. - I was originally iterating through the data
> programatically and using an INSERT query to place the data but for 5
> million rows this was taking far too long.
> 
> Again - any guidance is very much appreciated.
> 
> C.
> 
> 
> 
> 
> 
> 
> Griggs, Donald-2 wrote:
>> 
>>  
>> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Woodbridge
>> Sent: Wednesday, July 16, 2008 6:00 PM
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] Issuing command for bulk import
>> 
>> gtxy20 wrote:
>>> Hi,
>>> 
>>> I the following commands from my application to bulk import data from 
>>> a tab delimited text file (over 5 million records).
>>> 
>>> -separator "\t" test.db ".import data.txt testtable"
>>> -separator \t test.db ".import data.txt testtable"
>>> 
>>> but I keep getting the following error - expected 2 columns of data 
>>> but found 1.
>>> 
>>> Now I have checked the data.txt and have confirmed that it is a 2 
>>> column tab delimited flat text file. I am thinking that the separator 
>>> is not being properly recognized because I parsed some sample data as 
>>> semi-colon delimted and used the following with no problems.
>>> 
>>> -separator ; test.db ".import data.txt testtable"
>>> 
>>> Any help is very much appreciated.
>>> 
>>> Celeste.
>> 
>> ====================
>> The command line utility should tell you which line it doesn't like.
>> Does it always complain about even your first record?
>> 
>> 
>> This email and any attachments have been scanned for known viruses using
>> multiple scanners. We believe that this email and any attachments are
>> virus free, however the recipient must take full responsibility for virus
>> checking. 
>> This email message is intended for the named recipient only. It may be
>> privileged and/or confidential. If you are not the named recipient of
>> this email please notify us immediately and do not copy it or use it for
>> any purpose, nor disclose its contents to any other person.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Issuing-command-for-bulk-import-tp18496217p18498127.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to