How to Bulk Rename Files from a List: CSV, TXT & Excel Methods
When you need precise control over new filenames, use a list. Here's how to rename files from CSV, TXT, and Excel files.
Preparing Your Rename List
CSV Format
old_name,new_name
IMG_001.jpg,beach-sunset-2024.jpg
IMG_002.jpg,beach-family-portrait.jpg
IMG_003.jpg,hotel-pool-morning.jpgTXT Format (tab-separated)
IMG_001.jpg beach-sunset-2024.jpg
IMG_002.jpg beach-family-portrait.jpg
IMG_003.jpg hotel-pool-morning.jpgMethod 1: PowerShell with CSV
Import-Csv "rename-list.csv" | ForEach-Object {
Rename-Item $_.old_name $_.new_name
}With error handling
Import-Csv "rename-list.csv" | ForEach-Object {
if (Test-Path $_.old_name) {
Rename-Item $_.old_name $_.new_name
Write-Host "Renamed: $($_.old_name) -> $($_.new_name)"
} else {
Write-Warning "File not found: $($_.old_name)"
}
}Method 2: Bash with CSV (Mac/Linux)
while IFS=, read -r old_name new_name; do
mv "$old_name" "$new_name"
done < rename-list.csvMethod 3: Python Script
import csv
import os
with open('rename-list.csv', 'r') as file:
reader = csv.DictReader(file)
for row in reader:
old = row['old_name']
new = row['new_name']
if os.path.exists(old):
os.rename(old, new)
print(f"Renamed: {old} -> {new}")Method 4: Excel VBA Macro
Sub RenameFiles()
Dim ws As Worksheet
Set ws = ActiveSheet
For i = 2 To ws.Cells(Rows.Count, 1).End(xlUp).Row
oldName = ws.Cells(i, 1).Value
newName = ws.Cells(i, 2).Value
Name oldName As newName
Next i
End SubCreating Your List Efficiently
From File Explorer
- Open folder in Command Prompt
- Run: dir /b > filelist.txt
- Open in Excel
- Add new names in column B
Using Excel Formulas
Generate new names with formulas:
=CONCATENATE("2024-01-",A1)Tips for Success
- Back up first - Always keep copies
- Test on samples - Try 5 files before 500
- Check for duplicates - Ensure unique new names
- Match extensions - Keep file extensions consistent
When Lists Aren't Practical
For truly intelligent naming without manual lists, File Renamer AI analyzes file content and generates meaningful names automatically.
Try File Renamer AI - Skip the spreadsheet.
Free tools
Related Posts
How to Rename an Excel File (and How to Rename a Sheet Tab)
How to change the file name of an Excel workbook on Windows, Mac and the web, how to rename a sheet tab, and how to rename many files from an Excel list.
WindowsBatch File Rename in Windows 11: All Methods Explained
Complete guide to batch renaming files in Windows 11. From built-in features to PowerShell and third-party tools.
DocumentsDocument Renamer: How to Rename Documents in Bulk
Master document renaming for Word, Excel, PDF and more. Best practices for business document organization.
Ready to organize your files?
Try AI renaming right away. No sign-up needed until you download.
Try It Free