Move all text after "keyword" to front of file name

Bulk Rename Utility How-To's

Move all text after "keyword" to front of file name

Postby KarnbirR » Tue Apr 28, 2020 2:47 am

Hello,

Im trying to figure out how I can switch text after by to the front of my file names.

Eg.

iPhone by Apple

to

Apple - iPhone

This looks like a RegEx type of issue, I'm not sure how to tell BRU to take all text after a certain phrase

Your help is much appreciated! :)
KarnbirR
 
Posts: 2
Joined: Tue Apr 28, 2020 2:43 am

Re: Move all text after "keyword" to front of file name

Postby Admin » Tue Apr 28, 2020 4:05 am

Try:

Match : (?i)(.*)by(.*)
Replace: \2 - \1
Admin
Site Admin
 
Posts: 2344
Joined: Tue Mar 08, 2005 8:39 pm

Re: Move all text after "keyword" to front of file name

Postby therube » Tue Apr 28, 2020 4:07 am

1:RegEx
Code: Select all
Match:  (.*)\sby\s(.*)
Replace:  \2 - \1


Find anything up to the last instance of <space>by<space>, then everything that follows it, switching their orders, with a dash thrown in.
therube
 
Posts: 1315
Joined: Mon Jan 18, 2016 6:23 pm

Re: Move all text after "keyword" to front of file name

Postby KarnbirR » Tue Apr 28, 2020 5:34 am

Admin wrote:Try:

Match : (?i)(.*)by(.*)
Replace: \2 - \1
therube wrote:1:RegEx
Code: Select all
Match:  (.*)\sby\s(.*)
Replace:  \2 - \1


Find anything up to the last instance of <space>by<space>, then everything that follows it, switching their orders, with a dash thrown in.


Both of these worked flawlessly! Thank you so much! I love BRU such a great utility, just a little steep learning curve :)
KarnbirR
 
Posts: 2
Joined: Tue Apr 28, 2020 2:43 am


Return to How-To


cron