Hi,
I have an application in which I needed to read a number of files (quantity and name unknown until runtime) in a directory. I set up an array that holds the file names in setup paragraph. I then did a Call System for this command string:
let $cmd = getenv('COMSPEC') || ' /C dir ' || $SrcDir
let $cmd = $cmd || $FilePrefix || '*' || $DATType || ' > ' || $DirFile
call system using $cmd #status WAIT
I opened dirfile.txt for reading, record=65, and put into the array any line where the initial characters matched a prescribed filename prefix.
Then in the main loop I just read each element of the array.
Note that the filenames placed in the array were 8.3 format, but that would work OK when I used that same filename in the OPEN command in the main loop.
Please write if any of this wasn't clear.
Bob
-----Original Message-----
From: Hrair Tcholakian [mailto:htcholakian@MBHCONSULTING.COM]
Sent: Wednesday, January 26, 2000 4:51 PM
To: SQR-USERS@list.iex.net
Subject: Open for reading without knowing full filename [GDnnP.TXT]
Hi All,
Is there a way to Open for reading without knowing full filename [GDnnP.TXT].
I have a specific directory that I need to read a file from but the name is
dynamic in a sense where the nn is a numeric value that could change. Path
is [ c:\temp\GDnnP.TXT ]
I'm running this on Windows95 against an Oracle DB. SQR version 3.x
Thanks,
-Hrair