I'm having a issue with my recent code to split my record into respective copybook field.
Here is my sample input
Sample Input:
Code:
1) abcd,,cdef,"New York, US","New business",Jason
2) abcd,,cdef,"New York, New Jersey,US",,Jason
3) abcd,,cdef,,"New Business",Jason
Expected output is
Code:
Record 1
field 1 = abcd
field 2 = spaces
field 3 = cdef
field 4 = New York, US
field 5 = New business
field 6 = Jason
Code:
Record 2
field 1 = abcd
field 2 = spaces
field 3 = cdef
field 4 = New York, New Jersey,US
field 5 = Spaces
field 6 = Jason
Code:
Record 3
field 1 = abcd
field 2 = spaces
field 3 = cdef
field 4 = Spaces
field 5 = New business
field 6 = Jason
My concern will be more on field 4 because if i use Parse stopaft comma, it will split the field New York, US into 2 different field.
At the same time I want to remove the " from the field4 and field5 in record 1 & 2
Is it possible to use a direct Parse to get the output as shown above?
did You notice that Your previous topic was edited to use for the data the code tags ?
and the same has been done with this one!
code tags use a fixed pitch font an make data more understandable
doing so from the beginning shows good manners
and saves the moderators time to edit poorly formatted posts
Thanks Enrico for pointing out. I was searching for this code function to make it more easy to read but can't find it. I will be more careful next time.
Please do not post in more than one forum at a time - it wastes your time and everyone else's. Apart from being considered rude.
Hi Nic, apologies as I do not have the intention to post twice because I thought I should post at the other topic since I looking for different type of solution. Will be more aware next time. Thanks