Solved I need to read a text file and use each line as a variable..

July 9, 2012 at 17:18:47
Specs: Windows 7
I need to read a text file and use each line as a variable then use that variable in another command then go back and start over until all lines are processed..

each line has a file name..

help


See More: I need to read a text file and use each line as a variable..

Report •


#1
July 9, 2012 at 17:40:25
✔ Best Answer
@echo off & setlocal enabledelayedexpansion
set c=0
set cmand=type
for /f "tokens=*" %%a in (textfile) do (
set /a c+=1
echo processing line !c!: "%%a"
%cmand% "%%a"
)
:end
not tested. Try before you Fly...

Report •

#2
July 9, 2012 at 18:36:52
Thanks! I see where I was going wrong. this works. Thank you!!!!

Report •

Related Solutions


Ask Question