[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Reading Multiple Files and Renaming Input File
- Subject: Re: Reading Multiple Files and Renaming Input File
- From: Gracen Duffield <gduffiel@TDHCA.STATE.TX.US>
- Date: Wed, 21 Jul 1999 18:37:54 -0500
hmmm.
1. Put all the "Name_*.dat" files in their own directory
2. write a batch file that performs these two lines
echo > Namer
for %I in (Name_*.dat) do @type %I >> Namer
Now all of your input files will be in one big file called Namer (or
whatever you want).
If you want to delete all of the files at the end of the batch, use the del
Name_*.dat command.
call the batch file from the sqr using call system. There have been a lot
of posts
using the call system command, so please search the archives.
let Namer be your input file.
Gracen Duffield
Texas Department of Housing and Community Affairs
475-3839
-----Original Message-----
From: Aaron Chang [mailto:Aaron.Chang@ANU.EDU.AU]
Sent: Wednesday, July 21, 1999 6:04 PM
To: Multiple recipients of list SQR-USERS
Subject: Reading Multiple Files and Renaming Input File
Hi all
I'm new to SQR and have been asked to perform the following task for an
interface.
I've written an SQR to read information from a flat file. However, the input
file name will change daily - based on a prefix of the program name and a
time stamp (ie. NAME_CCYYMMDD_HHMMSS.dat). In addition after reading the
input files, the SQR program is required to rename the suffix of the input
file from 'dat' to 'pro'.
Because of the daily name change there is the possibility that the SQR will
need to read from multiple files with the prefix 'NAME_' to pick up the
correct file and suffix 'dat' to ensure that the same file is not read
twice.
Does anyone know of a way to loop the SQR until it has read all files
prefixed by "NAME_" and suffixed by 'dat'. Also, a way to rename the input
file dynamically from the SQR program (ie. rename the suffix of the input
file from 'dat' to 'pro'). I've been told that there is a way to execute DOS
command from SQR to rename the input file but I'm unsure of the syntax.
If anyone can help, it would be greatly appreciated.
thanx
aaron