Page 1 of 1

iterating over multiple types of files?

Posted: 13 Oct 2014 01:31
by pstein
In a DOS batch script I want to iterate over MULTIPLE (!) types of files.

Therefore I coded:

for /R "D:\work\data" %%a in (*.TXT *.LOG *.DAT) do (
....)

However only *.TXT files are found and processed.
Why not the *.log and *.dat files?

Peter

Re: iterating over multiple types of files?

Posted: 13 Oct 2014 02:59
by pieh-ejdsch
are there log and dat files in it?

Phil

Re: iterating over multiple types of files?

Posted: 13 Oct 2014 04:09
by foxidrive
pstein wrote:for /R "D:\work\data" %%a in (*.TXT *.LOG *.DAT) do (....)

However only *.TXT files are found and processed.
Why not the *.log and *.dat files?


Just agreeing that it works fine.
If the filetypes are there then the error is in how you are processing them, or they are locked.