Vern, I appreciate you taking the time. I'll try to digest this over dinner (or supper, depending upon your place of birth) this evening.

Thank you.

"Vern Hamberg" <vhamberg@xxxxxxxxxxx> wrote:

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

then
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
COUNTER = 98
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.
Vern

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

with.

On 4/28/2011 4:33 PM, Hockchai Lim wrote:
I've a ifs file with content like below:
EWREST_id_0='861';
EWREST_wfstate_0='Open';
EWREST_summary_0='SummSumm -TW';
EWREST_boss_ciss_customer_no_0='1234';
EWREST_id_1='761';
EWREST_wfstate_1='Open';
EWREST_summary_1='Test -TW';
EWREST_boss_ciss_customer_no_1='123456789';

Each line basically contains a key-value pair data. Does anyone
know
if
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
time?
thanks





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

--
Sent from my Galaxy tablet phone with with K-9 Mail. Please excuse my brevity.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 by midrange.com 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].