MultiRenameTool: RegEx Remove parts and change dot to space

English support forum

Moderators: Hacker, petermad, Stefan2, white

BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

MultiRenameTool: RegEx Remove parts and change dot to space

Post by *BullFrog »

Hello

I want method to quick rename my movies in one round with Total Commander with built-in multi rename tool.

But I stuck. I want movies like this:
La.boum.1980.720p.Anything.Any.Word

To become this:
La Boum (1980)

My friend made this to achieve the renaming
Search: (\.)(\d{4}).*
Replace: $2

La.boum (1980)


But how can I replace the dots (.) with space?
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Search for (.*)\.(.*)\.(.*\d{4}).*
Replace with $1 $2 ($3)
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: RegEx for multi rename

Post by *Stefan2 »

BullFrog wrote: La.boum (1980)

But how can I replace the dots (.) with space?
FROM:
La.boum (1980)
TO:
La boum (1980)

DO:
- select file(s)
- open Mutirename Tool
- Search&Replace
Search: .
Replace: ~
[_] E
[_] RegEx


Search for an dot and instead of ~-sign enter a space.


- - -


And the RegEx for

La.boum.1980.720p.Anything.Any.Word
Anything.Any.Word.FourDigits.Anything.Any.Word

to
La.Boum (1980)
Anything.Any.Word (FourDigits)

would be
Search: (.+)\.(\d{4}).*
Replace: $1 ($2)
[_] E
[X] RegEx

 
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:Search for (.*)\.(.*)\.(.*\d{4}).*
Replace with $1 $2 ($3)
And what If there were more dots? What if the movie title had more than 2 words? Or maybe just one?
Titanic Or Scream.Queens.Horror.Heroines.Exposed.2014.720p.BluRay.x264


@Stefan2
I really want to make it work in one rename with one regexp.
User avatar
nsp
Power Member
Power Member
Posts: 1951
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Code: Select all

Search for : '\.+'
Replace with       : ' '
[x]RegExp
And give a try
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

nsp wrote:

Code: Select all

Search for : '\.+'
Replace with       : ' '
[x]RegExp
And give a try
It only replaces dots with spaces, but does not format the text: Title (date) and remove the rest.
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Is this even possible?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

You have to do it with two renaming steps, if you want to do it in TC.

Or utilize "Edit names..." from MRT and use a text editor with scripting...
Or use script wdx plugin and a VBS script...

Or best use a dedicated renaming tool, where you can add several renaming steps and then rename at once.

But performing two times a renaming with TC might be suitable enough, depending how often you will need such operations.
1) shorten the name
2) change the dots


 
User avatar
Dalai
Power Member
Power Member
Posts: 10032
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

I regularly rename TV recordings of OnlineTVRecorder.com and use two renaming profiles in TC for this task. It's quite easy to apply them one after the other since you can select a profile with F2 and reload the file list (in MRT) with F5.

So, in essence
  1. mark the files
  2. call the MRT (Ctrl+M)
  3. press F2 there and select the renaming profile
  4. press Enter to rename the files
  5. press F5 to reload the file list into the MRT
  6. press F2 again and select the second renaming profile
  7. press Enter
And that's it. It may look more complicated than it really is, at least once you have your renaming profiles ready to use.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog

Small vbs script for you

https://yadi.sk/d/-mz8f4GBfmut8

Create button from code below

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (.+)\.(\d{4}).*
shell32.dll,115
Rename Files


-1
Select files to rename and press button
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:2BullFrog

Small vbs script for you

https://yadi.sk/d/-mz8f4GBfmut8

Create button from code below

Code: Select all

TOTALCMD#BAR#DATA
Rnm.vbs
%F (.+)\.(\d{4}).*
shell32.dll,115
Rename Files


-1
Thank you!

Near perfect, but it only works for FILES and not for FOLDERS, is it possible to implement to work for both?
Last edited by BullFrog on 2015-04-05, 17:57 UTC, edited 1 time in total.
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Rename folders or files in them?
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:Rename folders or files in them?
Folders! The files in folders can remain the old, Kodi needs only the folders to be renamed like that.
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2BullFrog

Done.
Please try new one https://yadi.sk/d/-mz8f4GBfmut8
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
BullFrog
Junior Member
Junior Member
Posts: 68
Joined: 2011-06-20, 10:51 UTC

Post by *BullFrog »

Ovg wrote:2BullFrog

Done.
Please try new one https://yadi.sk/d/-mz8f4GBfmut8
Thanks for your effort!
I've tested it now, and tested to rename the folders too, but strangely files works perfectly, but it renames folders wrong.

Folder rename example:
The.Interview.2014.1080p.Bluray.Dts.X264.hun-trinity
To
The Interview 2014 (1080).hun-trinity

File example
The.Interview.2014.1080p.Bluray.Dts.X264.hun-trinity.mkv
To
The Interview 2014 (1080).mkv

File example without file extension
The.Interview.2014.1080p.Bluray.Dts.X264.hun-trinity
To
The Interview 2014 (1080).hun-trinity
Post Reply