Page 1 of 1

Multi-Rename Tool with find/change list

Posted: 2019-02-26, 17:58 UTC
by PrzemekRyk
Hi All,

I'm wondering if it would be possible to add a bit of functionality to Multi-Rename Tool. I really often repeat some operations and it would be really great if I would be able to define them once, and then wait till Total Commander finish doing them one by one. Something similiar to Actions in Photoshop.

For example: I've got files with such filenames:
Youre.the.Worst.S02E01.The.Sweater.People.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E02.Crevasses.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E03.Born.Dead.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E04.All.About.That.Paper.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E05.We.Can.Do.Better.Than.This.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E06.Side.Bitch.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E07.There.Is.Not.Currently.a.Problem.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E08.Spooky.Sunday.Funday.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E09.LCD.Soundsystem.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E10.A.Right.Proper.Story.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E11.A.Rapidly.Mutating.Virus.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E12.Other.Things.You.Could.Be.Doing.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv
Youre.the.Worst.S02E13.The.Heart.Is.a.Dumb.Dumb.1080p.AMZN.WEB-DL.DDP5.1.H.264-SiGMA.mkv

I'm using mostly "Search & Replace" to run following operations on file names (Search for | Replace with, and <space> means pressing space on keyboard, <refresh> means pressing F5 on keyboard and refreshing file list):
. | <space>
<refresh>
Youre the Worst s01e | 01x
<refresh>
01x?? | 01x?? - You're the Worst -
<refresh>
<space>1080* | .mkv

The result in file names is:
01x01 - You're the Worst - Pilot.mkv
01x02 - You're the Worst - Insouciance.mkv
01x03 - You're the Worst - Keys Open Doors.mkv
01x04 - You're the Worst - What Normal People Do.mkv
01x05 - You're the Worst - Sunday Funday.mkv
01x06 - You're the Worst - PTSD.mkv
01x07 - You're the Worst - Equally Dead Inside.mkv
01x08 - You're the Worst - Finish Your Milk.mkv
01x09 - You're the Worst - Constant Horror and Bone-Deep Dissatisfaction.mkv
01x10 - You're the Worst - Fists and Feet and Stuff.mkv

So - I've got four operations. I have to do it step by step manually. But it would be much nicer and faster, if I could just load find & replace list from TXT file and let Total Commander do the rest. All by itself. With a capability to use regexp? Of course.

What do you think about it?

Regards,
PrzemekRyk

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-26, 22:38 UTC
by HolgerK
Only two operations needed (wich can be saved and recalled with "<F2> Load/save Settings")

-----
Search for:

Code: Select all

.
Replace with:<space-->

Code: Select all

 
[_] [E]xtension [_] Regex

Save as: "ReplaceDots"
-----
Search for:

Code: Select all

(.*)\WS(\d\d)E(\d\d)\W(.*)\W1080(.*)
Replace with:

Code: Select all

$2x$3 - $1 - $4
[_] [E]xtension [X] Regex

Save as: "ReorderTitle"
-----

1. <F2>Load: "ReplaceDots"
2. Start & refresh
3. <F2>Load: "ReorderTitle"
4. Start & done

HTH
Holger

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-27, 11:42 UTC
by PrzemekRyk
Well. First part gone well. Second part - well, the effect is:
01x01 - Youre the Worst - Pilot
01x02 - Youre the Worst - Insouciance
01x03 - Youre the Worst - Keys Open Doors
01x04 - Youre the Worst - What Normal People Do
01x05 - Youre the Worst - Sunday Funday
01x06 - Youre the Worst - PTSD
01x07 - Youre the Worst - Equally Dead Inside
01x08 - Youre the Worst - Finish Your Milk
01x09 - Youre the Worst - Constant Horror and Bone-Deep Dissatisfaction
01x10 - Youre the Worst - Fists and Feet and Stuff

I'm not regexp guru, but it's not the point. Here we're talking about to operations. It would be nice, if it would be possible to put them in one list, executed step by step. :)

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-27, 20:36 UTC
by HolgerK
PrzemekRyk wrote: 2019-02-27, 11:42 UTC Second part - well, the effect is:..
Well, this looks like you've forgotten to uncheck the replace in extensions:
<F1> help wrote:[E] Also replace the search text within the extension.
Rules for the case that this option is not checked:
1. When using the rename mask, only the part in "File name" will be modified by search+replace.
2. When loading the names from an external text file, the part starting with the last dot will not be modified.
Example: To replace all dots in the file name except for the one separating name and extension, uncheck this box.
Here we're talking about to operations. It would be nice, if it would be possible to put them in one list, executed step by step.
Two half automated steps reducing the effort of entering several different text strings are better than the four steps you started with.

Regards
Holger

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-27, 22:55 UTC
by Hacker
PrzemekRyk,
I really like how your season 2 files get automatically renamed into season 1 files :D
Anyways, for such multiple-step rename operations I'd suggest ReNamer with a preset like this .RNP file:

Code: Select all

[Rule0]
ID=Replace
Config=TEXTWHAT:%2E;TEXTWITH:+;WHICH:3;SKIPEXTENSION:1;CASESENSITIVE:0;USEWILDCARDS:0;WHOLEWORDSONLY:0
Marked=1
Comment=

[Rule1]
ID=Replace
Config=TEXTWHAT:Youre+the+Worst+s02e;TEXTWITH:02x;WHICH:3;SKIPEXTENSION:1;CASESENSITIVE:0;USEWILDCARDS:0;WHOLEWORDSONLY:0
Marked=1
Comment=

[Rule2]
ID=Replace
Config=TEXTWHAT:+;TEXTWITH:+%2D+You%27re+the+Worst+%2D+;WHICH:1;SKIPEXTENSION:1;CASESENSITIVE:0;USEWILDCARDS:0;WHOLEWORDSONLY:0
Marked=1
Comment=

[Rule3]
ID=Remove
Config=TEXT:+1080%2A;WHICH:3;SKIPEXTENSION:1;CASESENSITIVE:0;USEWILDCARDS:1;WHOLEWORDSONLY:0
Marked=1
Comment=
HTH
Roman

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-28, 19:42 UTC
by PrzemekRyk
Hacker

Well - I thought, that it would be nice to have that kind of tool in Total Commander (find and change by list). :) That's why I wrote my suggestion. :)

Re: Multi-Rename Tool with find/change list

Posted: 2019-02-28, 21:21 UTC
by Hacker
PrzemekRyk,
Oh, indeed. Well, your suggestion has my support.

Roman

Re: Multi-Rename Tool with find/change list

Posted: 2019-03-01, 12:56 UTC
by Stefan2
Support++

Till then maybe use a script in between:


Usage:
- Save the (dummy!) code in TC folder as "_ForEachSelFileDo_RenameInList.vbs"

Code: Select all

 VBS, AHK or Powershell
 
Read TCs-%F file
   For Each Line
        strLine = replace( strLine, "strSearchFor" , "strReplaceWith")
        strLine = replace( strLine, "strSearchFor" , "strReplaceWith")
        out=out+strLine+CRLF 
   Next Line
WriteTextfile  out > strResultfile
  
 
(((just ask if you would need a working script)))



- Create button in TC:

TC Button
Command: "D:\rive\path to\TotalCmd\Scrips\this.vbs" or best "%Commander_Path%\Scripts\this.vbs"
Parameter: "%F"
(Use the quotes as shown too for both cmd and param!)
In button dialog press F1-key to read more: %L, %l, %F, %f, %D, %d, %WL, %WF, %UL, %UF create a list file with the names of the selected files and directories,...

Startpath: <empty>
Icon: e.g. Script.exe -or- WCMICONS.DLL
Tooltip: e.g.: _ForEachSelFileDo_


- For each renaming, adjust the script


- - Select a few files and press the button
- - The script work and create a result file strResultfile in same folder

- - - Next select the files again and open MultiRenameTool
- - - In MRT use "Load names from file" (see [Help]-button) and select the strResultfile


- Inspect the New Name list if everything is fine....
- Rename
Done




 

Re: Multi-Rename Tool with find/change list

Posted: 2019-12-30, 13:31 UTC
by jjk
Support ++ also.

Re: Multi-Rename Tool with find/change list

Posted: 2020-01-01, 09:33 UTC
by jjk
I just discovered that MultiCommander has that feature as a built-in renamer extension, and more : one can save/restore sets of search/replace.
But, I want just have it in TC :)

Re: Multi-Rename Tool with find/change list

Posted: 2020-01-01, 12:54 UTC
by hi5
+1

Re: Multi-Rename Tool with find/change list

Posted: 2020-01-02, 16:50 UTC
by jjk
Also Advanced Renamer has that feature, but it is not integrated in TC :)