Import list of filenames in MultiRenameTool

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
berhan
Junior Member
Junior Member
Posts: 8
Joined: 2006-01-26, 14:50 UTC
Location: Serbia

Import list of filenames in MultiRenameTool

Post by *berhan »

I have thousands of files:
For example:
image1001.gif
image1002.jpg
image705.gif
....

And I have database like this:

Image_Name, Image_Filename

Alexander, image204.gif
Sonya, image3.jpg
River Danube, image9004.bmp

I want to have filenames like this:

Alexander.gif
Sonya.jpg
River Danube.bmp


my question is:

how can I import txt or any other file, witch will contain new filenames into MRT???????
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Why don't you talk on Serbian so anybody can understand you (2 alldomestic joke, don't replay)

I understand what you are trying to do, but you gave us too litle info.

Main questio: In what form is databse. TXT file ?


FIRST SOLUTION: This can be done externaly much better. Batch script .
Habemus majkam!
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

Welcome!
AFAIK TC can't do this out of the box, but you could try an external rename tool like the free tool Lupasrename. This one's capable of renaming files based on a textfile.

I think JOE File renamer can also do this, but I'm not sure. Some people here use this tool, I prefer Lupas...
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I prefer some script since it can be connected with TC
Habemus majkam!
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2majkinetor !
Right, I just pointed out some apps that can do what berhan asked for, a script is also a solution for sure...
User avatar
berhan
Junior Member
Junior Member
Posts: 8
Joined: 2006-01-26, 14:50 UTC
Location: Serbia

Post by *berhan »

majkinetor ! wrote: Main questio: In what form is databse. TXT file ?

FIRST SOLUTION: This can be done externaly much better. Batch script .
Database format is irrelevant, I can make it in any format. (CSV, TXT...)

Can you give me some kind of example of that script

Thanx
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Conversation transfered to ICQ. Dont post
Habemus majkam!
User avatar
berhan
Junior Member
Junior Member
Posts: 8
Joined: 2006-01-26, 14:50 UTC
Location: Serbia

Note to author

Post by *berhan »

Note to Mr. Ghisler

Please consider this as an idea for TC.

if you make it possibile to do it with TC there won't be need to use anything external.

thanx.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I agree with icfu. This is so stupid I can't beleive it is happening !

-----

I just wanted to post here some info about requested.

It turned out that database is in the format:

Database.txt

Code: Select all

"1";"1";"Baner";;"image1.gif";"0";"0";"0"
"2";"2";"Protest";;"image2.gif";"0";"0";"0"
"4";"2";"Foto dana";;"image4.gif";"0";"0";"0"
....
And the man wanted to select images and rename them acording to 3-th field.

This can be done using batch or much better Awk or Perl:

This is the key statement for the batch file:

Code: Select all

for /F "delims=; tokens=3" %i in ('type database.txt') do @echo %~i
This will return 3th filed alone.

Baner
Protest
Foto dana

Now.. with file selected in TC you do this:

Code: Select all

find "%1" database.txt >temp.txt
to export the line which contain desired name for selected file:

For instance:

Code: Select all

  find "image1.gif" database.txt
will give on the exit

Code: Select all

  "1";"1";"Baner";;"image1.gif";"0";"0";"0"
Now:

Code: Select all

for /F "delims=; tokens=3" %i in ('type temp.txt') do @set NAME=%~i
set NEWNAME_WITHEXT=%NAME%%x1
ren %1 %NEWNAME_WITHEXT% 
will do the trick for 1 file.


This can be easily upgraded to handle list of files selected.
Habemus majkam!
User avatar
berhan
Junior Member
Junior Member
Posts: 8
Joined: 2006-01-26, 14:50 UTC
Location: Serbia

again to the author

Post by *berhan »

Again to the author:

You see?????

for me this solution is very complicated

it's not the point to just do what man told me to.

I will now have to learn complete batch language becouse I want to understand this, and not to "JUST DO IT" :?

Dear Christian, please try to make it posible in MRT to rename files based on a textfle, it does not have to be pure database format, like CSV or somethind else, it is easy to manipulate text files and prepare it for renaming.

For example:

file can contain just rows with source filenames and target filenames

image1004.gif > something.gif
image5.jpg > any.jpg
...

or

image1004.gif;something.gif
image5.jpg;any.jpg

Thanx

PS

Thank you very much, majkinetor !
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I support this idea

------

2 berhan

You are working as administrator IIRC. This is not complicated and you should use batch script often during your job. You can't expect somebody else do your work. We can only give you notes on how that can be done, which is, if you ask me, more then enough... during my studies I didn't have that pleasure.

So, if you are waiting for Ghisler to do something about this, you are betting on the wrong horse! You can ask for it, of course, but if you stick to this forum for several moths you will understand my words. The chance for implementation of this request is, IMO, less then 1%.

It is much better and easier to learn batch, do this, and use that knowledge for all eternity then to wait for somebody to do it, especialy Ghisler.

---

Also if I may notice situation you mentioned above:
image1004.gif > something.gif
image5.jpg > any.jpg
can be easily converted to batch script via good text editor (I use Edit Plus) with few formating routines:
  • - first prepend ren to every line
    - delete > (replace with nothing)
    - save as batch and run
Second one:
image1004.gif;something.gif
image5.jpg;any.jpg
  • - replace ; with space
    - prepend ren
    - save to batch and run
Of course this is not equivalent to complete batch I told you first, because it has nothing to do with TC.
You will have to repeat formating procedure for every future request, and all files must be in the same folder, while in first case, you do it once, and only select files you want to rename and press a button (you can arrange files into subfolders also without a problem since you have CTRL + B feature)

best wishes
m.
Last edited by majkinetor ! on 2006-01-28, 16:38 UTC, edited 3 times in total.
Habemus majkam!
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2majkinetor !
So, if you are waiting for Ghisler to do something about this, you are betting on the wrong horse! You can ask for it, of course, but if you stick to this forum for several moths you will understand my words. The chance for implementation of this request is, IMO, less then 1%.
Well there has been a discussion about the topic in the German forum. Ghisler showed interest in the feature.
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

heh.... isn't that cool or what... we are having 3 forums... and just few people who reads them all... what a waste of knowledge .

2 God
You really spoiled everything with that Babylon Tower, you know!


EDIT: Leftious, I am curious, what is your real opinion about this. You are my guru, right! I must ask you.
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

still waiting....
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I still don't see the advantage of such a feature when you already have the pairs of old and new names in a text file!

When you write a batch file which creates such a list from the database, why not create directly a file like this:
ren image1004.gif something.gif
?
This would then work as a batch file without the need of any external programs like Total Commander! so can anyone explain what would be the advantage of doing this in TC? TC would have to use a specific list format, so a conversion to that format would still be needed - and when you do this, you could as well create a batch file directly...
Author of Total Commander
https://www.ghisler.com
Post Reply