Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Mon Jul 02, 2007 6:05 am Post subject:
what language do you plan on using for your solution? pick one!
This seems like a school problem.
I assume your expected output is:
Code:
1st I
2nd am a
3rd very
4th Good person
you actually have two delimiters. comma and double-quotes, which override the normal comma delimiter.
define a one dimensional table to contain double-quote positions, i.e. low-high range for each group
define a two dimensional table to handle the groups and sub-groups, i.e. primary dimension would contain groups, secondary dimension would contain the UNSTRING/PARSE of a group that was not bounded by double-quotes.
build a table of double-quote positions
UNSTRING or PARSE the input by the double-quotes, keeping track of the number of characters in each group
if the group came from a double-quote front & back delimited section of the input, change comma to space
if group did not have a front&back double-quote, UNSTRING/PARSE the group into subgroups delimted by comma, and space out the group
move non-space groups, sub-groups to final definitions
_________________ Dick Brenholtz
American living in Varel, Germany
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum