You need to sign in to do that
Don't have an account?
Ramesh T N 9
How to read csv file using Batch Apex class with using VF Page
Hi,
I have requirement to read csv file using Batch Apex without using VF page.
Could you please anyone help me with Batch Apex code.
Thanks and Regards,
Ramesh
I have requirement to read csv file using Batch Apex without using VF page.
Could you please anyone help me with Batch Apex code.
Thanks and Regards,
Ramesh
You can refer to this post.
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008v0tIAA
Thanks,
Pratik
Thanks for your quick response!!
I was seen post mentioned by you, but they are reading csv file using VF page tag.
<apex:inputFile value="{!contentFile}" filename="{!nameFile}" />
My requirement is to read csv file from my local or server machine directly from Apex code.
Best Regards,
Ramesh
you cannot read local files with a apex batch job form you local machine, thats why you need a VF page to upload this file. Therefore the only option is to have those files on a server or as attachments on a custom object.
In general i don't see the need to use a batch job for that. Apex batch jobs are meant for processing huge amount of already persisted data (in SFDC) that cannot be done in a single execution of a apex class.
So why don't you use the Data Import Wizard or DataLoader to import your csv file(s). If you really have a lot of csv files on a server which are dynamically added by another process a scheduled job is the better approach.
Again: The batch job split up a huge number of SFDC objects you receive by a query but do not split up the lines in a huge csv file or even processes a large amount of server sided csv files in defined portions.
But maybe i just don't understand your requirements.
Best,
Andreas