Multi rename [parent folder] tag

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
reekydeeky
Junior Member
Junior Member
Posts: 12
Joined: 2014-01-10, 15:27 UTC

Multi rename [parent folder] tag

Post by *reekydeeky »

While I've been using TC for well over a decade now on a daily basis, I'm still always enamored by the usefulness of the multi-rename tool.

One thing that's always frustrated me though, is that I can't find a tag or way of detecting the parent folder name?
Ie I have often multiple folders with the same named contents.

i'd like to rename for example:
product/Blue/item_xxx_description_001.png
To: product/Blue/item_Blue_description_001.png


currently I have 930 items to rename through a deep nest of folders, so you can see the frustration.

Am I just missing the function, or could I request the addition ?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Press F1 in MRT, you will find that [P] and [G] insert names of parent and grand-parent directories, and many more.
User avatar
white
Power Member
Power Member
Posts: 6014
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Multi rename [parent folder] tag

Post by *white »

reekydeeky wrote:i'd like to rename for example:
product/Blue/item_xxx_description_001.png
To: product/Blue/item_Blue_description_001.png
You will have to add parent folder name using the file name mask and use search and replace with regular expression to position the name at the correct place.

Rename mask: file name: [P]_[N]

Search for: ^(.*?)(_)(.*?)_.*?_|^.*?_
Replace with: $3$2$1$2

☑ RegEx
☐ Subst

(The last part of the regular expression "|^.*?_" is to remove the parent folder name again if the correct position could not be found)
reekydeeky
Junior Member
Junior Member
Posts: 12
Joined: 2014-01-10, 15:27 UTC

Post by *reekydeeky »

Oh good grief.. all these years and it was that easy !

This was exactly what I was looking for, and you wouldn't believe how much time it will save me (as if MRT wasn't a god-send already)

Many, many thanks for the responses.. it's left me all warm inside

:)
reekydeeky
Junior Member
Junior Member
Posts: 12
Joined: 2014-01-10, 15:27 UTC

Post by *reekydeeky »

Damn you Mr White, for introducing me to Regular Expressions. :wink:

I was happily oblivious of it until now. How have I managed before ?
My head hurt a little to start with, but now I'm all giddy with power.

Must.. stop.. experimenting..with .. newly discovered trickery
Post Reply