Chad, You may want to look at the FIND function which determines the location of a character, in your case comma, within a string. You will probably have to use it in a loop where you will find the location of the commas until you get to the ones you need. If you know the location of the commas before and after the field, you can figure out the length, then you can probably use the extract function. "Slattery, Chad" <Chad.Slattery@CSCLAC.IRLGOV.IE> on 08/31/2000 07:49:58 AM Please respond to sqr-users@list.iex.net To: SQR-USERS@list.iex.net cc: (bcc: Maria Talley/TPA/AdvanTech) 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] 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.Title: 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]
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.