Can you do multi substitions in ONE Multi Rename?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
louwin
Member
Member
Posts: 128
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Can you do multi substitions in ONE Multi Rename?

Post by *louwin »

I did search the forum and found 6107 matches but the few I checked didn't address my question. I also asked Copilot and, even though he had two suggestions (Regex), neither worked so I thought I'd ask here....

I want to change (for instance) all occurrences of abc to ABC, lmn to LMN and xyz to XYZ in multiple filenames. All three in one preset Multi Rename. Is this possible?

Copilot suggested - search: (abc|lmn|xyz) Replace @@$1@@ and "Subst!". There were other suggestions Replace $1 but, as said, they didn't work....
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
nsp
Power Member
Power Member
Posts: 1958
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Can you do multi substitions in ONE Multi Rename?

Post by *nsp »

yes it is possible for plain string.
if you want to replace 1 by a, 2 by b,... 9 by i you can do:

Code: Select all

search for: 1|2|3|4|0|5|6|7|8|9
Replace by: a|b|c|d||e|f|g|h|i 
--edited // an empty place holder in replace, will delete the corresponding match. i.e all 0 will be deleted

keep also in mind that replacement will be done from left to right one at the time See the next sample

Code: Select all

1|2|a
a|b|c  

Will replace all 1 by a, all 2 by b and all a (including replaced 1) by c
User avatar
white
Power Member
Power Member
Posts: 6022
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Can you do multi substitions in ONE Multi Rename?

Post by *white »

louwin wrote: 2025-06-27, 15:24 UTC Copilot suggested - search: (abc|lmn|xyz) Replace @@$1@@ and "Subst!". There were other suggestions Replace $1 but, as said, they didn't work....

Code: Select all

Search for: (abc|lmn|xyz)
Replace wit: \U$1

[X] RegEx
If the strings can occur in the extension too, deselect [E]. In that case, if you're using the same operation for folders as well, add [I] in front of the filename mask.
User avatar
louwin
Member
Member
Posts: 128
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: Can you do multi substitions in ONE Multi Rename?

Post by *louwin »

Search for: (abc|lmn|xyz)
Replace wit: \U$1

Thanks white 🙏🙏🙏 You're an ABSOLUTE marvel!!!! Just change the to \U! BEAUTIFUL!!!!
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
louwin
Member
Member
Posts: 128
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: Can you do multi substitions in ONE Multi Rename?

Post by *louwin »

I did further experimentation and found you can do it without RegEx by....

Search: abc|lmn|xyz
Replace: ABC|LMN|XYZ

Case closed?

Thanks for your responses.... 🙏👍
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
louwin
Member
Member
Posts: 128
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: Can you do multi substitions in ONE Multi Rename?

Post by *louwin »

nsp wrote: 2025-06-27, 15:48 UTC yes it is possible for plain string.
if you want to replace 1 by a, 2 by b,... 9 by i you can do:

Code: Select all

search for: 1|2|3|4|0|5|6|7|8|9
Replace by: a|b|c|d||e|f|g|h|i 
Sorry, nsp.... YOU answered my question perfectly BEFORE my experimentation. Thanks 🙏👌
There are 10 types of people in the world,
Those who understand binary and those who don't.
Post Reply