|
I have a routine that works like this... D Commas s 3 0 Dim(10)inz(*zeros) ... c reset commas c ',' scan srcdta commas c eval fld1 = %subst(srcdta:1:commas(1)-1) c eval fld2 = %subst(srcdta: c commas(1)+1: c (commas(2)-commas(1))-1) c eval fld3 = %subst(srcdta: c commas(2)+1: c (commas(3)-commas(2))-1) ... Just include fld1,2,3 in a datastructure... The scan function, places all the occurance of the ',' in an arrary... My data is pretty consitent so I didn't bother with much error checking, since this is an interactive process, and I visually check my data from this program. Tim > -----Original Message----- > From: David A Parnin [SMTP:daparnin@xxxxxxxxxxxxxxxxxx] > Sent: Friday, October 10, 2003 1:30 PM > To: midrange-l@xxxxxxxxxxxx > Subject: Parse variable length, delimited, data into a data > structure? > > > I could probably write something myself, but if there's code out there > > already, why reinvent the wheel? > > Because Goodyear tires may act unpredictably on your Ford Explorer? :) > > > > _______________________________________________ > 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. This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy the message.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.