There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem problems ram router slow sound trojan usb virus vista windows windows xp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Parsing the input to a batch file with the for command


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
mattslav's Avatar
Junior Member with 3 posts.
 
Join Date: Aug 2004
Experience: Intermediate
30-Dec-2005, 09:49 AM #1
Parsing the input to a batch file with the for command
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?
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:28 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.