importing .csv files into SQlite through objective C
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开发者_StackOverflow中文版 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
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.
精彩评论