You need to sign in to do that
Don't have an account?
G_N
How to read a CSV file using Apex/Visual force
Hi,
I want to read a CSV file using Apex/Visualforce. Can we read a CSV file using Apex/Visual force? Any code sample would be helpful.
Thanks in advance!!!
Thanks,
NG
Hi ,
Hi ,
you can use this type of tag on VF page
<apex:inputFile value="{!contentFile}" filename="{!nameFile}" />
contentFile will be property of blob type.
you can parse by contentFile.tostring() . It will give you whole string of CSV file.
then use split method of Apex string object .
If you are still have a problem, then contact on kodiyakirti123@gmail.com
Thanks,
Kirtesh Jain
All Answers
Hi ,
Hi ,
you can use this type of tag on VF page
<apex:inputFile value="{!contentFile}" filename="{!nameFile}" />
contentFile will be property of blob type.
you can parse by contentFile.tostring() . It will give you whole string of CSV file.
then use split method of Apex string object .
If you are still have a problem, then contact on kodiyakirti123@gmail.com
Thanks,
Kirtesh Jain
how can I read a csv via apex? the usage is , user will store the file in documents folder and my apex code should periodically check for new files in that folder. And if found, process it.
The csv file is nothing but product master file, that I receive from other system.
thanks in advance..
Hi Mitesh,
Have you successful on implementing the approach you described, I am also looking for samething. Pls share your experience. thx.
no not yet .. I come from asp.net background, and they have very well documented the things. I am sure this must be true for any other platform too.
But when it comes to force.com, we are always hunting for the solution?? I wish they had well documented. ..