I was looking for a utility that can rename files using a list of names stored in a text file (one name per line).
It is something that AntRenamer ( https://www.portablefreeware.com/index.php?id=66 ) can do.
Go to "Actions", and in the list of actions AntRenamer can perform, there is the option "Take Names from List".
In addition I found on the internet a DOS Script that does exactly the same thing, which is nice if you don't have AntRenamer.
The script assumes that
- you create a text file (with the extension ".bat) with the script below. Name the script file whatever name you like, e.g renamenow.bat
- the script file, the files you want to rename, and the text file with the new names (in our example this file is named: "list.txt") are placed in the same folder
- the files you want to rename have all the same extension (MP3 in this example)
- the list of names is in a text file named list.txt (one name per line)
- the number of files to rename is the same as the number of lines in list.txt
- the names in list.txt will be appended to the original name
- double-click on renamenow to execute the batch
EXAMPLE
You have the following 5 original files:
Marching Band CD1_Part1.mp3
Marching Band CD1_Part2.mp3
Marching Band CD1_Part3.mp3
Marching Band CD1_Part4.mp3
Marching Band CD1_Part5.mp3
Content of list.txt
Alabama
Berkshire
Carolina
Delaware
Esperanza
Output: the 5 files are renamed as follow:
Marching Band CD1_Part1Alabama.mp3
Marching Band CD1_Part2Berkshire.mp3
Marching Band CD1_Part3Carolina.mp3
Marching Band CD1_Part4Delaware.mp3
Marching Band CD1_Part5Esperanza.mp3
This is probably NOT EXACTLY what you wanted, but it is very close, and a simple file renamer can beautify the new names.
Here is the Script (slightly modified from the original):
::CREDIT: https://stackoverflow.com/questions/200 ... -text-file
@ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION
<list.txt (
for /f "tokens=* delims=* " %%a in ('dir /b *.mp3') do (
set "xand="
set /p "xand="
ren "%%~a" "%%~na!xand!%%~xa"
))
NOTE1: You can rename any type of files, not only mp3 as in the example, just replace mp3 with the type of files you want to rename (pdf, etc....)
NOTE2: DOS Scripts are case insensitive
It is something that AntRenamer ( https://www.portablefreeware.com/index.php?id=66 ) can do.
Go to "Actions", and in the list of actions AntRenamer can perform, there is the option "Take Names from List".
In addition I found on the internet a DOS Script that does exactly the same thing, which is nice if you don't have AntRenamer.
The script assumes that
- you create a text file (with the extension ".bat) with the script below. Name the script file whatever name you like, e.g renamenow.bat
- the script file, the files you want to rename, and the text file with the new names (in our example this file is named: "list.txt") are placed in the same folder
- the files you want to rename have all the same extension (MP3 in this example)
- the list of names is in a text file named list.txt (one name per line)
- the number of files to rename is the same as the number of lines in list.txt
- the names in list.txt will be appended to the original name
- double-click on renamenow to execute the batch
EXAMPLE
You have the following 5 original files:
Marching Band CD1_Part1.mp3
Marching Band CD1_Part2.mp3
Marching Band CD1_Part3.mp3
Marching Band CD1_Part4.mp3
Marching Band CD1_Part5.mp3
Content of list.txt
Alabama
Berkshire
Carolina
Delaware
Esperanza
Output: the 5 files are renamed as follow:
Marching Band CD1_Part1Alabama.mp3
Marching Band CD1_Part2Berkshire.mp3
Marching Band CD1_Part3Carolina.mp3
Marching Band CD1_Part4Delaware.mp3
Marching Band CD1_Part5Esperanza.mp3
This is probably NOT EXACTLY what you wanted, but it is very close, and a simple file renamer can beautify the new names.
Here is the Script (slightly modified from the original):
::CREDIT: https://stackoverflow.com/questions/200 ... -text-file
@ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION
<list.txt (
for /f "tokens=* delims=* " %%a in ('dir /b *.mp3') do (
set "xand="
set /p "xand="
ren "%%~a" "%%~na!xand!%%~xa"
))
NOTE1: You can rename any type of files, not only mp3 as in the example, just replace mp3 with the type of files you want to rename (pdf, etc....)
NOTE2: DOS Scripts are case insensitive
Statistics: Posted by juverax — Sun Feb 04, 2024 7:02 pm