At 11:03 AM -0500 11/27/00, Gregory Lypny wrote:
> 1. Because of the size of the raw data files, I want to read in
>one record at a time into a temporary variable, process it, and then
>empty it before proceeding to the next record.
>
> I've used
>
> read dataFile until "//"
>
>successfully to read in exactly one record. But how can I repeat this
>one-record-at-a-time process until the end of the file? Can I nest the
>read command within a repeat loop, something like the following?
>
> repeat until eof
> read dataFile until "//"
> (process data)
> end repeat
>
> 2. About filtering or picking off specific records: I need to
>find records with a specific ID or a specific CYTOBAND. I'm currently
>using the lineOffset function to confirm in each record that an ID line
>or a CYTOBAND line exists, and then I'm using the Match function to grab
>the information in those lines. Is this reasonable? Is there a better
>way?
>
> 3. Processing a whole data file may take some time. Is there a
>way that I can allow the user to abort the read should they have to?
Regarding 2, you could probably construct a single MatchText command.
I don't know if it would be more efficient than lineOffset or not.
Regarding 1 and 3, do something like this:
on startReading
global bigFilePath,bigReadMessage
open file bigFilePath
send readARecord to me in .01 seconds
put the result into bigReadMessage
end startReading
on readARecord
global bigFilePath ,bigReadMessage
read from file bigFilePath until "//"
if the result is not empty then
close file bigFilePath
exit readARecord
end if
--process the record here
send readARecord to me in .01 seconds
put the result into bigReadMessage
end readARecord
on cancelBigRead --call this from command-period, etc.
global bigReadMessage
cancel bigReadMessage
end cancelBigRead
regards,
gc
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.