Wish B4i lib wrapper for CHCSVParser

b4auser1

Well-Known Member
Licensed User
Longtime User
There are StringUtils.LoadCSV/LoadCSV2 to load csv files. They work great, but sometimes there is need to process rows from csv line, by line to avoid memory issues with big csv files.

Properly parsing CSV (comma separated value) files can be difficult due to the memory limitations on iOS devices, and the need to handle different encoding formats.

Here’s a library from Dave DeLong called CHCSVParser that can parse and create CSV files properly on iOS devices.

CHCSVParser avoids memory issues by only parsing a section of the file at a time, and lets you easily deal with different delimiters, and encoding formats. You can supply the file to be parsed or provide an NSString or NSStream containing the CSV information.

You can also save data to a CSV format with your choice of delimiter.

You can download CHCSVParser on Github here.

If you’re looking to download and parse a remote CSV file you may want to look at this AFNetworking extension that uses CHCSVParser to perform the CSV parsing.

If you’re having issues with parsing/saving CSV data this library makes it easy.

https://maniacdev.com/2013/01/open-source-objective-c-library-for-easily-parsingwriting-csv-files
https://github.com/davedelong/CHCSVParser
 
Top