+ Start a Discussion
Sonali BhardwajSonali Bhardwaj 

CSV Parsing in Apex

I have some requirement, I need to parse CSV in Apex through RegEx.

I am able to parse it successfully using some string functions (split, substring, etc.) but I want to parse it through RegEx.


Could any one please help me on RegEx for CSV parsing?




Did you checked following sample codes? 

I hope they will help.
Sonali BhardwajSonali Bhardwaj

Thanks Prasanna for your response.

The code given on the URLs does not hanlde the case when a field's value contains new line character(\n).


Also, I need some help on Regular Expressions.My requirement is to parse CSV using RegEx.

Shiv ShankarShiv Shankar

Have you found solution for this problem ?

I ran into the same trouble, and had to fight with the new CPU limits. Check out this parser; fast and compliant: