Multi Rename: remove string from multiple files.

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
tcebob
Member
Member
Posts: 178
Joined: 2003-03-23, 22:11 UTC
Location: Sunrise FL, USA

Multi Rename: remove string from multiple files.

Post by *tcebob »

I've used multi rename before but can't seem to set up to remove a string from multi files.
Given:

Code: Select all

05 - Die schöne Müllerin, Op. 25, D. 795_ 4. Danksagung an den Bach.mp3
Rename to:

Code: Select all

05 - 4. Danksagung an den Bach.mp3
Thus removing the string "Die schöne Müllerin Gerhaher, D. 795\".
There are 25 entries in this album

Should I be using the Rename mask or Search & Replace?
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Search for Die schöne Müllerin, Op. 25, D. 795_
Replace with "" (empty string, without quotes)
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: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Multi Rename: remove string from multiple files

Post by *Stefan2 »

As Ovg says.

But if you have different file names but with same pattern, better use this:


FROM:
05 - Die schöne Müllerin, Op. 25, D. 795_ 4. Danksagung an den Bach.mp3
TO:
05 - 4. Danksagung an den Bach.mp3

Rule:
You have to find a common rule to dedect the wanted part to be removed.
Here for example:
Find: 'two digit, space hyphen space'
Find: anything till 'underscore, space'
Find: 'the rest till the end'.

In RegEx syntax:
Find: '\d\d - '
Find: '.+_ '
Find: '.+'

So search and replace:
Search: ^(\d\d - )(.+_ )(.+)$
Replace: $1$3
[x]RegEx


-or just-
Search: ^(\d\d - ).+_ (.+)$
Replace: $1$2
[x]RegEx

In MRT press F1-key to read more, also follow the 'regular expressions' link there.



 
tcebob
Member
Member
Posts: 178
Joined: 2003-03-23, 22:11 UTC
Location: Sunrise FL, USA

Post by *tcebob »

Image: https://imgur.com/a/FGwMk

Thanks for the detailed instructions.

Here's a screen shot. Did I miss something? When I run it the file immediately above becomes ".mp3". Clearly I'm not getting this. I also tried wild cards with no success. How do I tell it which file(s) I want to change?
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

tcebob wrote:
Here's a screen shot. Did I miss something?
You still have to use the [N] and the [E] part first too.
That is your name ([N].[E]) on which we work on the search&replace part.
Since you drop the [N], all what is left is the [E].



And don't mix my two s&r examples as you did in your screenshot.
Use the first or the second example. Take a deeper look.





 
tcebob
Member
Member
Posts: 178
Joined: 2003-03-23, 22:11 UTC
Location: Sunrise FL, USA

Post by *tcebob »

Success! And thanks for your patience and expertise.

In my humble opinion the Multi Rename tool is A. Very powerful and B. Out of reach for non-programmers. RegEx is not a native language for many casual users. Can you think of a way to use wild cards to do the same thing?
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

2tcebob
I think that casual users are using Explorer ... :D

BTW There is description of regex in help file and it isn't a rocket science :D
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
cybey
Junior Member
Junior Member
Posts: 2
Joined: 2020-11-04, 13:27 UTC

Re: Multi Rename: remove string from multiple files.

Post by *cybey »

Hello everyone,

I found this forum and thread via Google and have a question:

I have two types of files in a folder. The first one starts with "apollo_" and the second one with "apollo_ED_". Somewhere in the file name I have the expression "Corr1" (without quotation marks), which I would like to replace with "Corr0". So the goal is to replace "Corr1" with "Corr0" for all files that start with "apollo_ED_".

This sounds easy, but I haven't found a solution yet. Unfortunately, I do not have any experience with regular expressions and I'm already going nuts. :D

I look forward to your answers. :)
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Multi Rename: remove string from multiple files.

Post by *gdpr deleted 6 »

cybey wrote: 2020-11-04, 13:33 UTC I have two types of files in a folder. The first one starts with "apollo_" and the second one with "apollo_ED_". Somewhere in the file name I have the expression "Corr1" (without quotation marks), which I would like to replace with "Corr0". So the goal is to replace "Corr1" with "Corr0" for all files that start with "apollo_ED_".
Your hunch about regular expression being able to provide a solution (or probably different variants of solutions) was not wrong, despite you not having experience with it.

The following regex pattern assumes your filenames contain only one occurence of "Corr1". If "Corr1" occurs multiple times in a file name, only the last "Corr1" will be replaced.

Search for:

Code: Select all

(apollo_ED_.*)Corr1
Replace with:

Code: Select all

$1Corr0
The checkboxes should be set as follows:

Code: Select all

[ ] ^    [ ] E    [X] RegEx    [ ] Subst
If you want/need case-sensitive matching (for whatever reason), enable the ^ checkbox.
Last edited by gdpr deleted 6 on 2020-11-04, 14:23 UTC, edited 1 time in total.
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Multi Rename: remove string from multiple files.

Post by *Ovg »

I think that
Search for (apollo_ED_.*)Corr1
and replace with $1Corr0 would be enough
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
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Multi Rename: remove string from multiple files.

Post by *gdpr deleted 6 »

Ovg wrote: 2020-11-04, 14:21 UTC I think that
Search for (apollo_ED_.*)Corr1
and replace with $1Corr0 would be enough
Yes, indeed :)
cybey
Junior Member
Junior Member
Posts: 2
Joined: 2020-11-04, 13:27 UTC

Re: Multi Rename: remove string from multiple files.

Post by *cybey »

Great, thanks. It worked! You are my time and stress savers. :)
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Multi Rename: remove string from multiple files.

Post by *Ovg »

2elgonzo
2cybey
:thumbsup:
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
Post Reply