importCSVtoCoreData is a tool that import csv file
importCSVtoCoreData is licensed under the MIT License. Please see the LICENSE file for specific details.
importCSVtoCoreData suppurts to import a CSV file written with specified format to CoreData.
- Mac OSX Snow leopard or Lion
- Xcode 4.X
- Build this project
- Open the finder that importCSVtoCoreData binary exists.
- Copy a momd(CoreData schema definition) directory to the above path.
- Run the following command on a terminal.app.
importCSVtoCoreData [table-name]_xxxxxx.csv [sqlite-file-name] [xcmodel-name]
ex) Import Members_test.csv to importCSVtoCoreData.sqlite with importCSVtoCoreData.momd of xcdatamodel.
$ ./importCSVtoCoreData Members_test.csv importCSVtoCoreData.sqlite importCSVtoCoreData.momd EntityName:Members .. Success!! Saved to 2 contents.
This sample is in PROJECT_HOME/Samples.
- FileName : [table_name]_[tag].csv
- 1st line : Field name with "," separator
- 2nd line : Field type with "," separator
- Over 3rd line : data with "," separator
You can import following field types in Current version.
- 0 : String type
- 1 : Number type
- 2 : Binary type
This sample is in PROJECT_HOME/Samples.
importCSVtoCoreData depends on CSVParser class of Matt Gallagher.
http://cocoawithlove.com/2009/11/writing-parser-using-nsscanner-csv.html
Thank!
Please consider following the @sockspaw Twitter.