Reputation: 490
I am able to import .csv files into a SQlite table through the command line. It works nice and fine. What i wanted to know was is it possible to do the exact same thing through Objective C code..meaning execute commands like .mode csv && .import file.csv table.
The interface sqlite3 does all normal SQL statement execution like selecting, deleting etc..But i am not sure about the importing part.
Any guidance anyone? Thanks in advance Regards
Upvotes: 1
Views: 2398
Reputation: 284836
You can try the virtual table described on the ImportingFiles page. However, you may best off just using an existing Objective-C CSV parser, then inserting each row yourself (within a transaction). See Anyone know of a good csv to NSArray parser for objective-c for a start.
Upvotes: 2