Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Split at comma with " characters

Former Member
0 Likes
1,875

I am uploading a comma separated file using the the SPLIT AT ',' command. But on field contains the following string "RN 90055358,9005", which should be interpreted as one field, however it is splitting this field into 2 fields.

I thought the quotes (") identified the field was to be treated as a string. How can I ensure that this field is not split?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
800

It would if you were importing it to Excel, but not in ABAP.

You option, if this field always has a comma in it would be to give 2 work fields for your split and then concatenate them back

together into the final field.

You could also split the string into a table and then use describe to know how many fields were returned.

If they are X you know there is no comma in that field. If there is X+1 you know this field had a comma and needs to be

concatenated into the final table.

Also, the " (double quotes) will be added to the field.

TRANSLATE and CONDENSE may help you there or

TRANSLATE and SHIFT LEFT

Hope this helps

I am uploading a comma separated file using the the SPLIT AT ',' command. But on field contains the following string "RN 90055358,9005", which should be interpreted as one field, however it is splitting this field into 2 fields.

I thought the quotes (") identified the field was to be treated as a string. How can I ensure that this field is not split?

2 REPLIES 2
Read only

Former Member
0 Likes
801

It would if you were importing it to Excel, but not in ABAP.

You option, if this field always has a comma in it would be to give 2 work fields for your split and then concatenate them back

together into the final field.

You could also split the string into a table and then use describe to know how many fields were returned.

If they are X you know there is no comma in that field. If there is X+1 you know this field had a comma and needs to be

concatenated into the final table.

Also, the " (double quotes) will be added to the field.

TRANSLATE and CONDENSE may help you there or

TRANSLATE and SHIFT LEFT

Hope this helps

Read only

rajasekhar_matukumalli3
Active Participant
0 Likes
800

Hi,

This is a common issue while loading CSV files. That is why you have make sure that there are no ',' between texts. As it happened in your case.

If I were you, I would explain the problems loading a ',' separated file and how the file should be sent.

In order to avoid any such problems, it is always suggested to use tab de-limited files.

Regards,

Raj