[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Unstringing
- Subject: Re: Unstringing
- From: "Ivory, Wayne" <Wayne.Ivory@ILUKA.COM>
- Date: Fri, 1 Sep 2000 11:56:11 +0800
Chad,
What O/S is your file in? If it's Unix I would suggest pre-processing it
with something like "cut" or "awk" specifying comma as your delimiter to get
only the columns you want and outputting to a temporary file. You could do
this from within SQR with a "call system using". Then your main SQR routine
can process just the temporary file.
Wayne Ivory
Information Services
Iluka Resources Limited
-----Original Message-----
From: Slattery, Chad [mailto:Chad.Slattery@CSCLAC.IRLGOV.IE]
Sent: Thursday, 31 August 2000 19:50
To: SQR-USERS@list.iex.net
Subject: Re: Unstringing
Maria,
Thanks for the suggestion but I think I need to have exact length fields to
use the 'Extract' function. Some of my fields contain names and so will
have varying length.
My record is delimited by comma so I think if there was some way to do a
count of the commas in the record....
Chad.
-----Original Message-----
From: Maria Talley [ mailto:Maria_Talley@ADVANTECHSOLUTIONS.COM
<mailto:Maria_Talley@ADVANTECHSOLUTIONS.COM> ]
Sent: Thursday, August 31, 2000 12:28 PM
To: SQR-USERS@LIST.IEX.NET
Subject: Re: Unstringing
Use the extract function which copies a portion of a string into another
string
variable.
For example:
extract $field100 from $record 99 1
$field100 is where the value will be stored
$record is the variable from which the string is to be extracted
99 is the starting location and 1 is the length
(note that the starting location is not 100 because the left-most character
starts at zero)
"Slattery, Chad" <Chad.Slattery@CSCLAC.IRLGOV.IE> on 08/31/2000 04:50:03 AM
Please respond to sqr-users@list.iex.net
To: SQR-USERS@list.iex.net
cc: (bcc: Maria Talley/TPA/AdvanTech)
Subject: Unstringing
Hi all,
Does anyone know if its possible to do the following? Im opening a file for
reading and unstringing a record into fields. The amount of fields could be
quite large but I'll only need a set number of them for my task. My
question is, is it possible to get a field from the record without having to
take all the fields out first?
eg,
record 1 has 500 fields, I only need to get the 100th,200th,300th,400th and
500th field, is there a way I can do this without unstringing the 500 fields
into variables?
Im trying to use arrays as I will have to use the arguments dynamically
later on in the program.
TIA,
Chad.
-------------------------------------------------------------------------