I have an excel sheet with data such as File Name
and I would like to compare if the file names
in the cells exist in my folder. These files are inside a specific folder in my main folder. So I would want to know which files are missing.
1 Answers
Please refer to this link since there is a good coding example. There are a few ways to do this but my first thought is to use PowerShell to write a script that reads your excel columns and rows, than as it reads each item, it checks a path to see if that item exists. To get you started, here is another good link to read excel cells using PowerShell.
As you read each cell in your for loop your going to check if it exists in your main path:
$MainFolder = "C:\MyMainFolder";
for ($i=0; $i -le $rowMax-1; $i++)
{
$name = the fileName in the row you are reading;
if ($name does NOT exist in $MainFolder){
//do whatever you want with that information.
}
$i = $i + 1;
}
Im not going to write out the code for you but I believe you could achieve your goal with a little more research (maybe do some more research before asking SO next time too). That second link literally gives you the script for reading excel cells.
Also, you could do this in python if you dont like PowerShell. Check out this link.

- 123
- 1
- 13