delimited File

george.j.wen@us.abb.com george.j.wen@us.abb.com
Mon, 19 Aug 2002 09:42:28 -0500


If your file has more than a small amount of records QTP can be a real
hog for this process but
Quiz does a good job.  It's quite simple actually, once you get the hang
of it.  You use "relative
indexing" where you scan for the delimiter for each field.  For example
let's say you want name,
addr, city out of a file.  You'll have transferred your file to a
subfile that has one large field in it  that's
large enough to hold the longest record of your file.  Let's call the
file TRANSFER-FILE and the
field WORK-FIELD.  Then in Quiz you'll do something like the following:
Access TRANSFER-FILE
def I1 = index(WORK-FIELD,",")                ;*** fine the delimiter
(comma in this case)
def NAME char*40 = WORK-FIELD[1:I1 - 1]  ;*** byte 1 through the index -
1
def WORK-FIELD-2 char*nnn = WORK-FIELD[I1 + 1:nnn - I1]
;***redefine the rest of work-field so you can start the process over
                                         ;nnn is the length of
work-field
def I2 = index(WORK-FIELD-2,","]         ;*** index the new work field
for the next field in the file
def ADDR char*40 = WORK-FIELD-2[1:I2 - 1]     ;*** def the next field
def WORK-FIELD-3 char*nnn = WORK-FIELD-2[I2 + 1:nnn - I2]    ;*** start
process again as in WORK-FIELD-2

def I3 = index(WORK-FIELD-3,",")
def CITY char*25 = WORK-FIELD-2[1:I3 - 1]
and so on......................

Report Summary NAME ADDR CITY
Set Subfile
Name....................................................................
etc.


hope this helps.  It works well and fast in Quiz - even for a large file


|---------->
|          |
|---------->
  >--------------------------------------------------------------------|
  |                                                                    |
  >--------------------------------------------------------------------|







-----Original Message-----
From: Arnone, Anthony [mailto:aarnone@grey.com]
Sent: Sunday, 18 August 2002 7:47 a.m.
To: 'powerh-l@lists.swau.edu'
Subject: delimited File


I have a comma Delimited file and I need to read it in Quiz and break
out
each individual field. The Record looks like this:

099000,00172,02,07,01,800

I am not exactly sure what is the best and easiest way to accomplish
this.


               Anthony