Hi All,
I have a multi-line string containing in a variable.
I have been trying to find a way to parse it - the first thing I want to know
is how many lines are in the string. I can't really use LINES since it only works against a file and I would rather not create a file just for this - would like to be be able to keep everything in the var. Once I know the number of lines, I would like to place the first word of each line in an array.
No I can get the first word of the entire string but have not been able to find anything out there quite along these lines.
I could probably use PARSE and break it apart at each LF but this seem pretty involved to something so simple.
I apologize for the basic question, but I just started dabbling in REXX recently - if I could use bash for this, I would already be done with it.
Any help is appreciated.
Thanks!
I have a multi-line string containing in a variable.
I have been trying to find a way to parse it - the first thing I want to know
is how many lines are in the string. I can't really use LINES since it only works against a file and I would rather not create a file just for this - would like to be be able to keep everything in the var. Once I know the number of lines, I would like to place the first word of each line in an array.
No I can get the first word of the entire string but have not been able to find anything out there quite along these lines.
I could probably use PARSE and break it apart at each LF but this seem pretty involved to something so simple.
I apologize for the basic question, but I just started dabbling in REXX recently - if I could use bash for this, I would already be done with it.
Any help is appreciated.
Thanks!