I'm working on making a batch that rename files base on cvs file. I will look in a input dir for a file containing the whats in the first part of the cvs, then move and change the name to what in the seconded part of the cvs. so it should work like this...
Master.cvs
A3,09
33,72the batch file would look in the C:\input for a file name A3.txt then when it finds it. the batch would move the A3.txt to C:\output with the new name of 09.txt
thanks for any help.
@echo off for /F "tokens=1-2 delims=," %%a in (Master.csv) do ( if exist "C:\input\%%a.txt" move "C:\input\%%a.txt" "C:\output\%%b.txt" )
Thanks, but that only worked on the top line of cvs. can it loop through each line?
Are you sure? I have a huge experience in For /F statements and do assure the code I posted browses the whole Master.csv file performing the if exist for each line inside.
that was my bad i was using some bad sample data.. Thanks so much.
| « Create folder - partial f... | [Solved] How Do I Check If a Progr... » |