"be consistent" | |
PerlMonks |
Character Text Delimitersby Ninthwave (Chaplain) |
on Oct 25, 2011 at 15:55 UTC ( [id://933642]=perlquestion: print w/replies, xml ) | Need Help?? |
Ninthwave has asked for the wisdom of the Perl Monks concerning the following question: I have a string that is generated from a database. The string contains multiple records. The program that generates this string appends a two character code to the front of each string. Example: AA(<text values>), AB(<text values>), AC(<text values>) Note the parentheses, commas and spaces are not part of the text values, but the text values themselves may contain commas and parentheses. I am looking for the elegant way to capture each value, noting that the order is important as AA lines up with another dataset. Also note that so far I have seen this string with as many as 400+ values scrolling into QR and above though I have not seen if the system has any option for when the value exceeds ZZ so I used ZZ as my upper limit. Also the reason I have an array for the sting value is the data field that this string comes from is an array though so far only the first element has been populated. I need more examples to determine if I will be able to change the section with @{$strings} to just $string in the future. My solution - improvements or better algorithms sought
And the _alpha_add sub
UPDATE: Please note as a delimiter is most likely the wrong term, as the format prepends the data and is absent at the end of the string.
"No matter where you go, there you are." BB
Back to
Seekers of Perl Wisdom
|
|