Reputation: 1139
I am working on a iphone project . I want to parse a CSV file. From whatever I found, the
libraries available for CSV parsing is only for MAC , not for iphone. I want a simple approach
for parsing CSV file only for iphone. Any help is greatly appreciated
Upvotes: 1
Views: 3657
Reputation: 13127
This is a nice CSV parser with support for streams: https://github.com/davedelong/CHCSVParser
If you are parsing a file that comes from the web, then you could also use https://github.com/acerbetti/AFCSVRequestOperation which is using the AFNetworking library for downloading the file.
Upvotes: 4
Reputation: 899
CSV is basically a comma separated list of values. You can use NSString
methods componentsSeparatedByString:
or componentsSeparatedByCharactersInSet:
for that.
Suppose you have a comma separated string, calling [myStringCSV componentsSeparatedByString:@","]
will give you an NSArray
with the values.
Upvotes: 0