I need help for Importing large CSV files via Batch Apex. I have tried this link => http://developer.financialforce.com/customizations/importing-large-csv-files-via-batch-apex/ .But unable to implement it.Please help.
The problem is that you are trying to reference a static variable incorrectly.
return new CSVIterator(m_csvFile, m_parser.crlf);
return new CSVIterator(m_csvFile, Parser.crlf);
When you want to reference a static member you prefix it with the class name and do not use an instance of the class.
Try this ImportCSVJob class as a reference implementation of
Schedulable. The class demonstrates how you can use CSVReader to read CSV data, construct new records and then insert those records.
Try testing your job with the simple Lead-import.csv data below:
FirstName,LastName,Company Marty,Chang,Slalom Consulting Homer,Simpson,Springfield Nuclear Power Plant
You can schedule the job or run the job using the Developer Console to execute the following as anonymous Apex:
Database.executeBatch(new ImportCSVJob(), 1);