I use a code to remove all files in a folder that contain some words saved in a CSV file.
This code reads every line of my CSV file, and after searches every word read in CSV and delete the files that in our source have these word.
Now I need to adapt this code to use like value the second column of my CSV.
My list.csv
file:
1,DRWORDAAA
2,ERWORDBBB
3,BCWORDCCC
99,ASWORDZZZ
My batch file:
for /F "delims=" %%a in ('findstr /M /G:"D:\Program Files\list.csv" "D:\Program Files\myfolder\*.log"') do del "%%a"
I need to set like values to search the 2 columns of my CSV (in my example from DRWORDAAA
to ASWORDZZZ
).
My CSV has hundreds of lines and the words to search can be different, but the structure is always the same.
Actually, the batch file code reads only the first column of CSV and do not recognize the seconds column.