Dennis, et al.

This has taken a while, but I was at COMMON when you asked and am just getting back to this.

Parsing in REXX can be done many ways - with patterns, by position, lots of options. This is an example of using relative position -

parse var output name +25 question +50 counter +10

This will take the variable "output" and parse it into 3 variables - "name", "question", and "counter". The value in output is 3 fixed-length values of length 25, 50, and 10 respectively.

If output = Vern What've I done? 247

name = Vern
question = What've I done?
counter = 247

The above came from using the CGI API that converts a query string.

Patterns can also be used - here is something similar to the above -

The variable output = FM_name='Vern'; FM_counter='98'; FM_question='What have I done now?'

This statement gives results as desired -

parse var output "FM_name='" name ,
"'; FM_counter='" counter ,
"'; FM_question='" question "'" .

Commas are continuation symbols at the end of a line.

Full quotes are used to delimit single quotes - so it's full-quote FM_name= single-quote full-quote, etc.

Result is -

NAME = Vern
QUESTION = What have I done now?

I hope that gives you some idea of the capability you have with REXX. The manuals are available at Infocenter under the programming area.

On 4/29/2011 7:29 AM, Dennis wrote:
Hi Vern. Care to demonstrate?

"Vern Hamberg"<vhamberg@xxxxxxxxxxx> wrote:

One of the best parsing "utilities" is REXX - native on i, easy to work


On 4/28/2011 4:33 PM, Hockchai Lim wrote:
I've a ifs file with content like below:
EWREST_summary_0='SummSumm -TW';
EWREST_summary_1='Test -TW';

Each line basically contains a key-value pair data. Does anyone know
there is already an open source utility that can read and parse this
type of
data file where caller can basically ask for a pair of data at a

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
Sent from my Galaxy tablet phone with with K-9 Mail. Please excuse my brevity.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].