Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Rename files using Excel database

$
0
0

Hello to all,

I have an Excel file with 2 columns. Column A has the name of a file and column B has the name that shall be renamed.

What I want is to read all the filenames of a folder and, search the Excel, if the file name exist then rename it to the one which is in column B.

For example, let's assume that I have a folder under the path:

c:\temp\folder

Within the folder I have 5 files under the names file1, file2, file3, file4, file5.

Then the script shall search the excel file and if file1 exists then it shall rename it to the one that exist in the same row but in column B. The same think for all th other files. So after script execution, all c:\temp\folder files will be renamed according to excel matching.

Thank you 


Viewing all articles
Browse latest Browse all 6937

Trending Articles