‎2009 May 28 5:21 PM
Is there a standard FM which handles csv file read? I am currently using a 'split at' to separate values but this fails when some strings ( within quotes) have commas.
Eg:
333,khdfs, "Company name", 87348, " Name1, Name2"
In this scenerio, the last field in quotes gets split into 2. I cannot handle this in the progrm because the last field does not always have a comma split. Any suggestions?
‎2009 May 28 5:38 PM
I think we don't have any easy way to do this.
My suggestion will be first search the string for starting " and ending " (offset) and then replace the , (in between 2 ") with some other symbol say # something like then go for split.
a®
‎2009 May 28 5:38 PM
I think we don't have any easy way to do this.
My suggestion will be first search the string for starting " and ending " (offset) and then replace the , (in between 2 ") with some other symbol say # something like then go for split.
a®
‎2009 May 29 11:04 AM
thats a good approach, probably the only approach. Do u have any code with u using offsets?
Pinaki, ur suggestion wont work
‎2013 Feb 15 4:09 PM
Rahul - I have same situation. I have a comma separated CSV file which has address fields with embedded commas in them.
Can you tell me exactly how this has been solved.
Many Thanks.
‎2009 May 28 5:38 PM
Hi Suker ,
First you remove all the Quotes , then split into coma (,).
I mean to say --
REPLACE ALL OCCURRENCES OF '"' IN <string_name> WITH SPACE.Now split the string at the coma - -
SPLIT AT ....Regards
Pinaki
‎2009 May 29 11:13 AM
Dear ,
I think you should save your file in excel with csv format and then upload this file with FM "GUI_UPLOAD'.
Regards,
Vijay
‎2009 May 29 11:17 AM
Hi,
use this FM
TEXT_CONVERT_TEX_TO_SAP
In the parameter i_field_seperator pass ",".
Regards,
Manish