[AccessD] (Really Really OT) - programatically sorting files in a folder

Gustav Brock gustav at cactus.dk
Fri Feb 14 13:45:01 CST 2003


Hi Oleg

Assuming that "Company's software" doesn't sort the files, you should
be able to do something like this if your files exists in d:\filedir:

<batch file>

@echo off

:: Kill old print dir.
del d:\printdir\*.*
rd d:\printdir

:: Recreate dir.
md d:\printdir

:: Copy files from file dir to print dir
:: in specific order.
copy d:\filedir\Loretta*.* d:\printdir
copy d:\filedir\Ginger*.* d:\printdir
     ... etc. ... 51 lines in total.
copy d:\filedir\Patricia*.* d:\printdir

:: end

</batch file>

Now, print files from d:\printdir
You will, of course, need to adjust directory names to your scenario.

/gustav


> It's totally not SQL, Access, VB related; that why is aid "really really OT"
> I think it could be solved with a batch file. I have to do yet another
> report daily, and the divisions have to be sorted in specific order.
> Company's software prints everything thats in a specific folder in one
> setting, then a human (usually me or secreatary) has to arrange them in
> order (which is always the same) I was wandering if those files (lets
> assume they are in a text format) can be sorted through batch file that
> would be run daily.

>>> I mean it should be the same way every day, but the order is not
>>> alphabetical - like
>>> Loretta01
>>> Ginger01
>>> Masha01
>>> Natasha01
>>> LaurenO1
>>> Anna01
>>> Patricia01
>>
>>> Its always the same group of 51 files, exsept on the next day it will
>>> be Loretta02 instead of Loretta01, and this way until o5 then it
>>> becomes 01 again. Well as I .bat allows wildcards. DO u think I can
>>> write a batch file that would say something like "sort in this order"
>>
>> Yes, but why must they be "sorted" (arranged) and what should the
>> batch file do (more)? What is your task? Or should we leave it as a
>> Friday joke?




More information about the AccessD mailing list