My question is very similar to the question posted here on stackoverflow but the difference for me is that I need the batch script to do the following
- Look at a csv file which has the name only without the image extension and find the image with that name in a particular directory
- Then take that file and copy it to another directory
What modifications would I need to do to this batch script to accomplish that task?
@echo off
for /f "tokens=1,2 delims=," %%j in (project.csv) do (
copy "%%j.jpg" c:\mytestproject\newimages
rename c:\mytestproject\newimages\%%j.jpg" %%k.jpg
)
The following Batch file assumes that the .CSV file contains just one field per line: the name, with NO extension, of a file that exist, with ANY extension, in a particular directory, so it copy that file to another directory.
If you want the image file have an extension taken from a limited list: