Parsing the input to a batch file with the for command

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mattslav

Thread Starter
Joined
Aug 15, 2004
Messages
3
I am "for" to parse the input (from a file given as the first parameter) to a batch file:

for /f %%g in (%1) do call :archive_data %%g

:archive_data starts immediately after this statement till the end of the file, then it returns to the for statement. It parses the input from the file the way I want it to, but after the file contents are exhausted it will run :archive_data with the name of the input file, i.e.
run :archive_data with the first line of the input file,
run :archive_data with the second line of the input file,
... ,
run :archive_data with the last line of the input file,
run :archive_data with the name of the input file.
Why is this happening?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top