1) UNSTRING the string into 3 parts (first , middle, last) - delimitedd by ".
2) INSPECT the string and replace all ',' to ':' for middle.
3) STRING all the 3 parts back delimited by space.
Try using the above approach, it should give you the desired result.
Hi kapil,
Thanks for your reply..
But my concern is that there are lot more " " in between the single rec.
Just for Example I have written One string in between " ".
And I am not sure how many " " comes in the record .
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
Reference modification comes to mind -- use a separate output string; go through the entire input string. If the current character is a " then flip a switch (initial value off) and go to the next character. If the current character is "," and the switch is set, change it and put in output. Otherwise, put in output.
1) INSPECT string and replace first " to @.
2) INSPECT string and replace first " to @.
Now use the logic posted earlier by me
4) UNSTRING the string into 3 parts (first ,middle, last) - delimitedd by @.
5) INSPECT the string and replace all ',' to ':' for middle.
6) STRING all the 3 parts back delimited by space. (insert# instead of @)
Note- # will let you know that this is the processed part of string.
Now keep on repeating all the above steps until you process the complete string.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
You could use the same basic code with another flag to indicate which output field should have the character added; probably not more than another 10 - 15 lines of code.