Can "import ascii" be used with multiple file handles on the same import file?

Michael Schwartz (PC Support & Services) filepromike at gmail.com
Fri May 31 08:27:14 PDT 2019


On 5/31/2019 8:08 AM, Michael Schwartz (PC Support & Services) via 
Filepro-list wrote:

>       filePro version 5.8.03.12D6 running on Centos 6
>
>       Before I spend a lot of time writing code to test this, do any of
you
> know if I can open the same file with "import ascii" using more than one
> file handle in the same processing table?  Something like:
>
> Import ascii NewOrder=(FF{"") r=\n  f=|
>
> Import ascii PreCheck=(FF{"") r=\n  f=|
>
>      FF is a huge text file with lines containing order numbers and part
> numbers and I need to "read ahead" through the lines in the file one order
> at a time to see if the order contains certain part numbers.  If these
> certain part numbers are present in that order, I have to do some
different
> things when I start reading and posting the data lines using the
"NewOrder"
> file handle.
>
>      I understand that "getnext"  and "getprev" don't work with "import
> ascii".  If they did then I wouldn't need to open the file twice.
>
>      If nobody gives me a definitive answer, I will write some test code
and
> let you all know how it works out.
>
> Thanks!
> Mike Schwartz
>
----- ----- ---------------------------------
-- Only if you close the first handle before you open the second.

-- This file will be open and locked, so the second import will fail as if 
-- you reach the end of the file.

-- Richard D. Williams
> _______________________________________________

       Ok, thanks!  I guess I will have to do something like opening import
file, reading it to the end, putting the PO # of those orders that have the
odd parts into a dim'ed array, then closing the import file and reopening it
to do the posting to the filePro order database, referencing the dimmed
array as necessary to handle the posting.  

Mike



More information about the Filepro-list mailing list