Ladies & Gentlemen,

My first post to this list, please be gentle!

I'm trying to import tab-separated data, example here:

40009402        FUND    NwL "NMF"NEAVB:GB;1 NQ  NwL "NMF"NEAVB:GB;1 NQ  
10000003                1991-02-14      1991-02-14
40009403        FUND    Nwl'MF"NEA VB:GB;1 Q    Nwl'MF"NEA VB:GB;1 Q    
10000003                1991-02-14      

Table:

CREATE TABLE Asset
(
        AssetCode TEXT PRIMARY KEY NOT NULL COLLATE NOCASE,
        AssetTypeCode TEXT NOT NULL COLLATE NOCASE,
        Name TEXT NOT NULL COLLATE NOCASE,
        ShortName TEXT COLLATE NOCASE,
        CurrencyCode TEXT COLLATE NOCASE,
        PerformanceTaxCountryCode TEXT COLLATE NOCASE,
        StartDate DATE,
        QualifiedStartDate DATE
);

I am not in control of the format or content, but have a command file, the gist 
of which is:

.mode tabs
.import Feeds/Asset.txt Asset

Line 1 of the import file is fine, but line 2 is rejected as only having 7 
fields instead of 8. I've experimented with ".separator" commands to no avail 
(e.g. ".separator='\t'). It appears the the shell tool is thrown by the 
(clearly) mismatched single and double quotes, but since I want it to use tabs 
as the separator should this be the case?

Of course I could write some code to look for strings like this and "fix" them, 
but then I won't end up with what the supplier has provided.

Am I missing a command here? Thanks for any input.

Mac OS-X 10.8.2, shell SQLite 3.7.12 2012-04-03 19:43:07 
86b8481be7e76cccc92d14ce762d21bfb69504af (latest).

Best regards,
Colin Hardwick
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to