I'm trying to find a good method to parse data out of a long string - I usually use index and substr, but I think that PARSE would be a better alternative. Problem is, I don't know how to use parse properly for something like this.
examples of string that I want to analyze:
1)#JI,ID=32
2)#JI,ID=(10-23,29,31,32)
3)#JI,ID=(10-22)
4)#JI,ID=10
5)#JI,ID=(10,11,12,13,14,15,16,17,18,19,20,21,22)
6)#JI,ID=(29,31,32)
I want to extract the numbers from the above strings. They will be used as subscripts for a stem variable at a later point.
To continue the example, the desired output would be
1)sub.1=32
2)sub.1=10,
sub.2=11,
sub.3=12
....
sub.14=23
sub.15=29
sub.16=31
sub.17=32
... and so on...
I'm gonna go ahead and try use index,substr, and delstr but from what I've heard/read PARSE is a much better way to do this. Anybody feel like pointing me in the right direction?
much thanks
PS: yeah, I know converting the string "10-23" into a 14 element stem has to be done with programming logic and can't be done thru PARSE.