The Mapping Rename: When You Already Know the Names
Most bulk-rename advice assumes one of two things. Either you want a uniform pattern (Invoice001.pdf through Invoice300.pdf, a single rule applied to every file), or you want a tool to read each document and figure out a name for you. The spreadsheet method is neither. It exists for the case where you already hold the correct names and just need to attach them to the right files.
This comes up more than you'd think. An accounting system exports a list of invoice numbers, but the scanned PDFs are named scan_0001.pdf through scan_0300.pdf. A case-management system knows every matter's proper name, but the documents on disk carry whatever the scanner assigned. A migration hands you a lookup table mapping old document IDs to new ones. In every one of these, the truth about what each file should be called lives in a spreadsheet or an export, not inside the PDF and not in some pattern.
So the job is mechanical, not clever. You need a two-column list, current filename in one column and target filename in the other, one row per file, and then a way to run through that list and rename each file accordingly. The spreadsheet is the source of truth. The rest is execution.
The key discipline is precision. A mapping rename does exactly what your sheet says, so a typo in the sheet becomes a wrongly named file, and a mismatch between the sheet and the folder becomes a skipped or failed row. The steps below are built around getting the sheet right first, then applying it safely with a preview before anything actually changes on disk.
Build the Mapping Sheet
Open Excel (or Google Sheets, or any spreadsheet) and make exactly two columns. Column A is the current filename, including the extension, exactly as it appears on disk right now. Column B is the target filename you want, also including the extension. One row per file. That's the whole structure.
The single biggest time-saver is not typing column A by hand. Get the current filenames directly from the folder so they match byte for byte. On Windows, open a command prompt in the folder and run dir /b > filelist.txt to dump a bare listing of every filename into a text file, or in PowerShell run Get-ChildItem -Name > filelist.txt for the same result. Open that text file, copy the names, and paste them straight into column A. Now column A is guaranteed to match reality, because it came from reality.
With column A populated, fill in column B with the names you want. This is where your export, index, or system of record comes in: if the correct names are already in another sheet, line them up and paste them across, or use a lookup formula to pull the right target next to each current name. Then sanity-check a few rows by eye to make sure the right target landed next to the right source.
A few rules keep the rename from failing later. Keep the extension on both columns; a target of Acme_Invoice_2025-03-14 with no .pdf will produce a file the operating system no longer treats as a PDF. Avoid duplicate values in column B, because two files cannot share one name in the same folder and the second rename will be refused. And strip illegal filename characters out of the target column: on Windows a name cannot contain any of these characters, backslash, forward slash, colon, asterisk, question mark, double quote, less-than, greater-than, or pipe. Slashes in a date or a colon in a time are the usual culprits, so replace them with hyphens or underscores before you export.
Export to CSV
A script or rename tool can't read a native .xlsx file directly, so save the sheet as CSV, which is plain text any tool can parse. In Excel, choose File, then Save As, and pick CSV (Comma delimited) as the format. Save it somewhere easy to reach, ideally in or next to the folder of PDFs.
Give the two columns a header row so the tools that read it know which column is which. Put OldName in the first cell and NewName in the second, on the very first row, above your data. So the file reads OldName,NewName on line one, then one row per file after that, current name comma target name. That header is what lets Import-Csv address the columns by name in the next step.
Quickly open the saved CSV in a plain text editor to confirm it looks right: a header line, then one line per file with exactly one comma separating old from new. If any of your names legitimately contain a comma, Excel will have wrapped that field in double quotes automatically, which is correct and expected. Leave those quotes alone.
Apply It With PowerShell (Import-Csv)
PowerShell reads a CSV natively and can drive the rename with a couple of lines. The Import-Csv command turns each row into an object with an OldName property and a NewName property (named after your header row), and you pipe those objects into a loop that renames one file per row.
The shape looks like this. First preview, changing nothing: Import-Csv .\mapping.csv | ForEach-Object { Rename-Item -Path $_.OldName -NewName $_.NewName -WhatIf }. The -WhatIf flag is the safety net. Instead of renaming anything, PowerShell prints what it would do, one line per file, so you can read down the list and confirm every old name is being matched to the right new name. Run this first, every time.
When the preview looks correct, run the exact same line with -WhatIf removed: Import-Csv .\mapping.csv | ForEach-Object { Rename-Item -Path $_.OldName -NewName $_.NewName }. Now it renames for real, one file per row, in order. Run it from inside the folder that holds the PDFs (or put the full path in the OldName column) so PowerShell can find each file. That's the whole execution: one line to preview, the same line to commit.
If you'd rather keep a record, you can log what happened by appending a redirect, but the -WhatIf preview is the step that actually prevents mistakes. Reading that preview is not optional, it is the difference between catching a misaligned column now and discovering it across 300 files later.
If you'd rather not touch a command line, several dedicated bulk-rename utilities can import a CSV or Excel file and use it to drive the renames, no scripting involved. You point the tool at your mapping file, tell it which column is the current name and which is the target, and it applies the list, usually with a preview grid so you can eyeball the pairing before committing.
The mechanics differ from tool to tool, but the concept is identical to the PowerShell approach and to everything above: your spreadsheet is the source of truth, and the tool is just the thing that walks the list and performs each rename. Whether the executor is a two-line script or a point-and-click utility, the work that matters, and the work that has to be correct, is the mapping sheet you built. Get column A and column B right, and any executor will do the same job.
Handling the Things That Go Wrong
A mapping rename fails in predictable ways, and each failure points straight at the cell that caused it. Knowing the three common ones turns a scary red error into a two-second fix.
A row whose OldName no longer matches a file on disk. If column A says scan_0007.pdf but that file was already renamed, moved, or was never there, Rename-Item reports that it can't find the path and moves on. The rename doesn't happen for that row, and the rest of the list continues. The fix is to correct that one cell so it matches the actual filename, then re-run. This is exactly why you pull column A from a live directory listing rather than typing it: the listing can't misspell a name that exists.
A target name that already exists. If two rows in column B resolve to the same name, or a target matches a file already in the folder, the operating system refuses the second rename rather than silently overwriting a file. That's protective, not a bug. De-duplicate column B (sort it and scan for repeats, or use a duplicate-highlight rule in Excel) so every target is unique, then re-run the ones that were refused.
The row count not matching the file count. If your sheet has 300 rows but the folder has 305 PDFs, or vice versa, something drifted between when you captured the listing and when you ran the rename, a file got added, removed, or renamed in between. Regenerate the directory listing, line it back up against column A, and reconcile the difference before you apply. A mapping that doesn't cover the folder one-to-one is a sign the source of truth went stale, and it's worth fixing at the sheet level rather than pushing through.
Spreadsheet Rename vs Pattern vs Content
| Approach | Where the new name comes from | Best when |
|---|
| Pattern rename | A rule applied to all files (a counter, prefix, or find-and-replace) that produces uniform, numbered names | Every file should get the same kind of name and you don't care what each one contains |
| Spreadsheet / Excel mapping | A list you built yourself, one exact target per file; you already know each name | You already hold the correct names in an export, index, or system of record and just need to apply them |
| Content-based | The tool reads the file; the name lives inside a scan or PDF and you don't have it yet | You're looking at a folder of documents and don't yet know what each one should be called |