Our department processes filenames that are currently in YYMMDD## format where the first file for today May 10 is uploaded as 09051001. The next file is uploaded as 09051002. After they are uploaded they go in a folder called archive. at the end of the day a folder is created called aryymmdd and the files are moved there from folder archive leaving folder archive empty.
Multiple new departments are being added and the filename is changing.
New filenames must be written in the format AAYmmddAAA format
The first two alpha characters will change according to the type of job.
The last three characters are first the alphabet and then 1-999
The first file is written to AA90510A.DAT and then placed in the archive folder.
When the next job is processed, it must look in the archive folder and find the highest letter.
For the second file it would write out AA90510B.DAT and move it to the archive folder
First file IC90510A.DAT
Second file IA90510B.DAT
Third file IA90510C.DAT
27th file IC905101.DAT
28th file IA905102.DAT
The first two alpha charcters do not influence the sequencing order of the files.
IA, IB, IC do not have to be kept separate and the order is random /mixed.
Slight modification of current code, but it is not working.
rem * Batch job designed to create a sequence number for the IA records used
rem * to upload contractuals at time of billing to PBAR. tammie sherwood 05/05/09
rem * Delete all text files once sequence has reached 99999 and start over with 0
if exist 19999.txt del 1*.txt
Copy .\10000.LOG .\10000.txt
rem * Control batch sequence with Set FILE command
for %%I in (10*) do set LIST=%LIST%%%~nI
set /A FILE=%LIST%+1
Copy .\10000.txt .\%FILE%.txt