You need to sign in to do that
Don't have an account?
Mohidheen N
Wants to convert string into CSV via apex code
I wants to convet the below string format into csv in Apex, do anyone having any idea or sample apex code to convert into csv document file and save the attachemtn in csv file format in attachment object.
NAICS CODE,LOC #,SUB LOC #,LOCATION NAME,ADDRESS,ADDRESS LINE 2,ADDRESS LINE 3,CITY,STATE/PROVINCE,COUNTY
551114,0,0,,adc,,,ABC,TX,ABCd
531110,2,1,,7729 WESTVIEW DR,,,ABC,TX,ABCd
334513,3,1,AAA-A,1330 WIRT RD,,,ABC,TX,ABCd
334513,3,2,AAA-B,1330 WIRT RD,,,ABC,TX,ABCd
Note: Column header count is ten in the above sample but it may very everytime.
NAICS CODE,LOC #,SUB LOC #,LOCATION NAME,ADDRESS,ADDRESS LINE 2,ADDRESS LINE 3,CITY,STATE/PROVINCE,COUNTY
551114,0,0,,adc,,,ABC,TX,ABCd
531110,2,1,,7729 WESTVIEW DR,,,ABC,TX,ABCd
334513,3,1,AAA-A,1330 WIRT RD,,,ABC,TX,ABCd
334513,3,2,AAA-B,1330 WIRT RD,,,ABC,TX,ABCd
Note: Column header count is ten in the above sample but it may very everytime.
Hi
Mohidheen N,
Please find the solution.
VisualForce Page:
Or You can use batch class
We get this in rest response and I tried to store in a string datatype but its not accepting it due to Line break in the text. I wants to inteligently understand the column count and then have to store in the list later convert into csv file.