By Say Goodnight Software
Open the Mac App Store to buy and download apps.
*** NOW OPEN SOURCED AT GITHUB! ***
EasyCSV2SQLite makes it easy to convert comma delimited text files to sqlite databases. The primary use would be to include datasets inside development projects. To further enable this, EasyCSV2SQLite will generate objective-c code necessary to read the created SQLite database.
EasyCSV2SQLite is a very simple application, but does its job well!
- each column is a VARCHAR(255)
- line endings for the CSV file can be LF/CR/CRLF
- first line used as column headers
- objective-c code generated for reading database
- uses NSScanner rather than componentsSeparatedByString so it properly parses commas in quotation marks
The code generation was initially based on code from a blog post at dBlog.com.au. Thanks to them for showing how easy it is to read SQLite from objective-c!
parts of it are working great
it is creating the tables fine for me, but not importing any rows. I like the portion that auto-generates he objective-c for reading the DB. unfortunate, as this app is very close to being a gem of a utility.
Worked once the never imported data again
This tool worked perfectly the first time I used it and created a new SQLite database with table and all the imported data. Then subsequent attempts to do the same thing with the exact same input CSV file failed to create anything but a database and a table. No data was ever imported again.
Not Ready for Prime Time
Only works for the simplest CSV files, hangs on others. Can't specify field separator (i.e. it must be a comma). Always writes a zero byte sqlite file. Code generation is a cute idea but will generate completely bogus code depending on the CSV input.