Mass moving word phrases with specific algorithm

A swapping-ground for Regular Expression syntax

Mass moving word phrases with specific algorithm

Postby Proper » Tue Nov 29, 2011 9:21 am

Hi!
I am new to this forum. :)
I love Bulk Rename Utility!
I would appreciate your kind help with this.

I want do a mass rename folder names like these.
I want to know how to move the letters which are in these endings and beginnings "(" ")" .
To calculate what are in this specific range which starts and ends with these "(" ")" letters to be able to move them to the front.

Mass renaming 1000 folder names like these

Good Brother - We Are Cool (TT123) CD
Friend of Mine - Infinty CDR (123PTS)
Jesus Raver(44TR12) - Highest High WEB

to this:

(TT123) Good Brother - We Are Cool CD
(123PTS) Friend of Mine - Infinty CDR
(44TR12) Jesus Raver - Highest High WEB

Thank you very much!

Best Regards
Proper
 
Posts: 2
Joined: Tue Nov 29, 2011 8:47 am

Re: Mass moving word phrases with specific algorithm

Postby dele » Sun Dec 04, 2011 3:37 pm

try this in Regex(1)
Match:
(.*)(\(.*\))(.*)
Replace:
\2 \1 \3
dele
 
Posts: 16
Joined: Sun May 22, 2005 12:00 pm

Re: Mass moving word phrases with specific algorithm

Postby Proper » Tue Dec 06, 2011 8:01 pm

Thank you!
It worked! :)
Proper
 
Posts: 2
Joined: Tue Nov 29, 2011 8:47 am

Re: Mass moving word phrases with specific algorithm

Postby ttx » Thu May 03, 2012 2:13 pm

Hey all

First of all, sorry for bumping quite an old topic. I'm also new with BRU, and I would like to know if it's possible to do same thing, but instead of moving matched strings, it should COPY it to the beginning.

Thanks in advance
ttx
 
Posts: 3
Joined: Thu May 03, 2012 2:10 pm

Re: Mass moving word phrases with specific algorithm

Postby dele » Thu May 03, 2012 2:40 pm

Hi ttx,
i am pretty sure, that this is possible.
But please provide an example, of what you want to do.

best regards
dele
 
Posts: 16
Joined: Sun May 22, 2005 12:00 pm

Re: Mass moving word phrases with specific algorithm

Postby ttx » Thu May 03, 2012 2:59 pm

Hey mate!

Thanks for the fast reply

What I want to do is following: Let's say you have some folders named this way

other_artist_-_something_else-(LBL002)-WEB-2012-grp
artist01_-_release-(LBL005)-WEB-2012-grp
rawr_rwar_-_justin_bieber_isagirl-(LBL008)-WEB-2012-grp
thirdsample_-_blabla-(LBL013)-WEB-2012-grp


These are folders with music inside, and "LBLxxx" is catalogue number of the release
I want to rename those folders in a way that string LBL and following 3 characters are copied on the beginning of the name, something like this:

LBL002_other_artist_-_something_else-(LBL002)-WEB-2012-grp
LBL005_artist01_-_release-(LBL005)-WEB-2012-grp
LBL008_rawr_rwar_-_justin_bieber_isagirl-(LBL008)-WEB-2012-grp
LBL013_thirdsample_-_blabla-(LBL013)-WEB-2012-grp

Normally, folders are sorted alphabetically, so this would give me nice and clear sorting by catalogue number

Any chance this can be done with BRU?

Thanks!
ttx
 
Posts: 3
Joined: Thu May 03, 2012 2:10 pm

Re: Mass moving word phrases with specific algorithm

Postby Jane » Sun May 20, 2012 7:30 am

I tried the following with those examples and it produced exactly what you wanted.
Regex(1)
Match:
^([^(]+\()([^)]+)(\).+)$
Replace:
\2_\1\2\3

How it works:
^([^(]+\()
means match everything from the start of the title that is NOT an opening parenthesis and the opening parenthesis,
and capture it as group 1.
([^)]+)
This matches the contents after the opening parenthesis up to the closing parenthesis, and captures it as group 2.
(\).+)$
This matches the closing parenthesis and everything thereafter to the end of the title, and captures it as group 3.

Since we have captured the the contents of the parentheses in group 2 and we want it added at the start we put it first in the replacement string (\2)followed by an underscore followed by the original order of the complete title (\1\2\3)

It assumes there will be only one set of parentheses.

HTH,
Jane
Jane
 
Posts: 24
Joined: Sat Aug 05, 2006 1:20 am

Re: Mass moving word phrases with specific algorithm

Postby ttx » Tue May 22, 2012 6:18 pm

works like a charm

thanks a lot mate
ttx
 
Posts: 3
Joined: Thu May 03, 2012 2:10 pm


Return to Regular Expressions