Gilles wrote:
> At 22:47 04/02/2008 +1100, John Machin wrote:
>   
>> Well, obviously(?)  you are closer to success with "\t" than with '\t'. 
>> You probably have an extra unseen TAB. It won't like that NULL.
>>     
>
> Thanks, but no matter what I try, it doesn't work:
> - just two columns, assuming it will just increment the primary key since 
> it didn't find anything for this column
> - three columns, with col#1 set to "NULL"
> - three columns, with col#1 set to just ASCII 09, ie. TAB
>   
If you are using TAB as the separator, col#1 can't be set to TAB -- I 
presume that you mean that col#1 is empty i.e. a zero-length string.

> How is your "barzot.tsv" formatted? How do you handle the first column that 
> works as an auto-incremented primary key?
>   
Like I said in my message:
"""

Here's what works for me:
C:\junk>type barzot.tsv
1       bar     zot
42      plugh   xyzzy
666     far     narkle
============= Yes, there are 2 TABs per line.
C:\junk>sqlite3

"""
It seems that .import doesn't do auto increment. You will have to use 
Dennis's two-pass technique, or write a small one-pass script in e.g. 
Python to read your file and insert the rows into the table.

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

Reply via email to