#1 2022-08-08 16:11

zugzuang
Member
Registered: 2022-08-08
Posts: 1

Rename multiple files using a txt file?

I'm looking for an option to rename multiple files using a .txt file as a guide to accomplish the task, for example:
I have a folder with 600 images.jpg files that I downloaded from the internet, all with random names, my.txt file looks like this:

jgdteriiknnuiu.jpg>Pescaria de Inverno.jpg
hdty64cgftpik.jpg>Jogos no Campo.jpg
8645fdcx7wp.jpg>Compras na Cidade.jpg

Maybe some will ask, but what is the use of this? Instead of wasting time creating the .txt file, it would be better to rename them one by one. In my case, I copied a part of the html from the site where I downloaded the images, the html with the 600 images was as follows, I just had the trouble of copying it to notepad and replacing what didn't interest me. Example:

<a href=/jgdteriiknnuiu.jpg>Pescaria de Inverno</a><br>
<a href=/hdty64cgftpik.jpg>Jogos no Campo</a><br>
<a href=/8645fdcx7wp.jpg>Compras na Cidade</a><br>

Note that in Notepad I only had the trouble of removing the <a href=/ and </a><br> which I didn't care about in the html.

I don't know if it's possible, but if I had a script or a program that used the .txt file to rename all the images in the folder it would be amazing. I don't know if such a program or script exists. Thanks for listening.

Offline

#2 2022-08-08 17:52

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Rename multiple files using a txt file?

Hi and welcome.

Your post will be moved to the ReNamer sub-forum.

There you can find already such solutions:

See https://www.den4b.com/wiki/ReNamer:Export_menu
> Import file paths and new names 
>> Imports file paths and new names from the .csv (comma separated) or .txt (tab separated) file.

See http://www.den4b.com/wiki/ReNamer:Rules:UserInput
> This rule replaces the original filenames with the names taken from the list



More questions? Just ask.



 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2022-08-09 00:50

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Rename multiple files using a txt file?

You will need to reformat your old and new names as follows:

jgdteriiknnuiu.jpg,Pescaria de Inverno.jpg
hdty64cgftpik.jpg,Jogos no Campo.jpg
8645fdcx7wp.jpg,Compras na Cidade.jpg

Save it to a file with a *.csv extension, place it into the same folder as your source files, and then use the Import file paths and new names option from the Export menu.

Note that you will need to use at least ReNamer 7.3.0.3 Beta in order to handle relative source file paths (1st column) in the imported CSV file. Older versions will expect full source file paths.

Offline

Board footer

Powered by FluxBB