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
Paul Bénard 5Paul Bénard 5 

​‘Regex too complicated’ while trying to import data from CSV

Hello community,

I am trying to import data from a CSV file with an Apex class.
To do it I am reading each lines of the csv.
To read it I am using the Regex "docBody.split('\n')" in order to read each lines of the CSV file (each lines terminated by the tag \n). 
Everything works fine till approximatively 11 000 lines!
BUT there is a problem when I want to import a file with more data. I obtain this error message :
‘Regex too complicated’ with a reference to the line where there is docBody.split('\n'). 
So when I want to import a big file Force.com can not support the REGEX.
Did you encountered this issue? Did you find a workaround?

Thank you for your help,

Paul.B
Simon ReparSimon Repar
User quietopus suggested the solution in another similar thread (post date: 20.11.2014). 

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xTLIAY