how to loop through lines in text file

September 16, 2010 at 10:46:12
Specs: Windows XP
I have a batch file that uses osql to retrieve information and output it to G:\RCE.txt
the results of that file will look something like this:
PUB Issue_Date
ACC_ 100110
JC_ 100110
JD_ 090110
MMW_ 092310

Now I have a folder that has 16 pdf's for each PUB example of one (ACC_BBSC050A.pdf)

What could I put in my batch file to append all 16 ACC_*.pdf files with the issuedate?
IE how could I turn ACC_BBSC050A.pdf into ACC_BBSC050A_100110.pdf?

See More: how to loop through lines in text file

Report •

September 16, 2010 at 11:13:37
What, something like this?
for /f "skip=1 tokens=1,2" %%a in (G:\RCE.txt) do for %%c in (%%a*.pdf) do ren %%c %%~Nc_%%b.pdf

Report •

September 17, 2010 at 05:40:25
Worked perfectly,
Thanx Razor

Report •

Related Solutions

Ask Question