Link to home
Start Free TrialLog in
Avatar of Beaker1974
Beaker1974

asked on

FOR loop can't find fileset.

I have a DOS batch file (win2k) that takes one arguement of a set of files, uses that arguement in a FOR /F statement and runs a utility for each of the entries on each of the lines, for each of the files that the FOR /F loop goes through.

I swear it worked 6 months ago, and now I need to run it again, and it keeps telling me "The system cannot find the file" of the arguement I put into the batch..

For example, lets say I have some files that end in .txt in a directory, so I run my batch with the *.txt arguement.
Instead of going through each *.txt file in the directory and running the FOR loop, it'll only give me the message "
The system cannot find the file *.txt.

What could I possibly be doing wrong?

here's the file...

echo Called with %1
FOR /F %%a in (%1) do C:\m2o\awk95 -f c:\m2o\sortu.awk < %%a > _%%a
echo "Done!"
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Beaker1974
Beaker1974

ASKER

That worked!  Why would the /F be the problem?
That's used to work on the output from commands one line at a time or to read the contents of a file one line at a time. Each line is referenced using %%a.