I have a CSV file which I have exported from our data module, which only contain product numbers. The product numbers are comma separated, which may or may not course a problem (I am not that good of a programmer). I found a fancy little batch here at stackoverflow, which has helped me to read the csv when running the batch, however, I am lost when it comes to trigger the right commands.
@echo off
set "theDir=C:\Web\Photos"
for /F "delims=" %%x in (C:\Web\MySQL_active_product_numbers.csv) do (
copy %theDir%\%%x*.* "C:\Web\ActivePhotos\"
)
I have set the directory I want to scan, using the theDir variable, and in my csv file I have a list a product numbers. Example of csv content (one column only):
10000,02,65
10000,25,65
10001,02,65
...
The files I want to copy contain more characters than what each line in the csv contain, which is why I need the wildcard search to locate and copy the file. Example of files.
10000,02,65 chocolate bar.jpg
10000,25,65 ice cream cone.jpg
10001,02,65 candy.jpg
....
I really want to copy the jpgs from one directory to another, but as you can see from my csv, I only have the product numbers to match the filename, but I can't figure out how to use the wilcard search within my batch, to loop through the csv, to locate each file and copy it to a different directory. I hope it all made sense, and I appreciate all your input and support with my batch problem. Thanks.