I have to read .csv file which has three columns. While parsing the .csv file, I get the string in this format Christopher Bass,\"Cry the Beloved Country Final Essay\",cbass@cgs.k12.va.us. I want to store the values of three columns in an Array, so I used componentSeparatedByString:@","
method! It is successfully returning me the array with three components:
- Christopher Bass
- Cry the Beloved Country Final Essay
- cbass@cgs.k12.va.us
but when there is already a comma in the column value, like this Christopher Bass,\"Cry, the Beloved Country Final Essay\",cbass@cgs.k12.va.us it separates the string in four components because there is a ,(comma) after the Cry:
- Christopher Bass
- Cry
- the Beloved Country Final Essay
- cbass@cgs.k12.va.us
so, How can I handle this by using regular expression. I have "RegexKitLite" classes but which regular expression should I use. Please help!
Thanks-