function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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?

_Prasu__Prasu_

Sonali,

 

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 ?

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

https://code.google.com/p/apex-csv-reader/source/browse/CSVReader.cls