Parsing Multi-Length Strings
Posted: Fri Dec 05, 2008 8:51 pm
I have a programming problem that I can't figure out how to do in DS Server ...
I have a column that can contain the following example set of values:
WRX-0001
WRX-0001.r1
WRX-0001.r2
RERWEEW-0001
RERWEEW-0001.r1
RERWEEW-0001.r2
I am trying to figure out how to read in a string, parse it as array, store the character within the array until I get to the '.r', then throw the rest of the string away.
In short, if you take the list of values above, I want to end up with this set:
WRX-0001
WRX-0001
WRX-0001
RERWEEW-0001
RERWEEW-0001
RERWEEW-0001
Any ideas on how to do this in Datastage Server? I could write a C program, read one character at a time, then when I get to two characters in the array that = .r, stop and write the value, then process the next record ...
Help!
I have a column that can contain the following example set of values:
WRX-0001
WRX-0001.r1
WRX-0001.r2
RERWEEW-0001
RERWEEW-0001.r1
RERWEEW-0001.r2
I am trying to figure out how to read in a string, parse it as array, store the character within the array until I get to the '.r', then throw the rest of the string away.
In short, if you take the list of values above, I want to end up with this set:
WRX-0001
WRX-0001
WRX-0001
RERWEEW-0001
RERWEEW-0001
RERWEEW-0001
Any ideas on how to do this in Datastage Server? I could write a C program, read one character at a time, then when I get to two characters in the array that = .r, stop and write the value, then process the next record ...
Help!