Relocate text in music filename

A swapping-ground for Regular Expression syntax

Relocate text in music filename

Postby blaylok » Tue Nov 28, 2017 8:31 am

Hi there,

I am having trouble setting up bru to rename my music filenames.

At present the filenames are like this:

01. Led Zeppelin - Black Dog.flac
02. Jimi Hendrix - Purple Haze.flac

And I want them to be like this instead:

01. Black Dog - Led Zeppelin.flac
02. Purple Haze - Jimi Hendrix.flac

I can't quite figure out how to do it?

Any help would be greatly appreciated.

Thank you,

blaylok
blaylok
 
Posts: 2
Joined: Tue Nov 28, 2017 8:19 am

Re: Relocate text in music filename

Postby KenP » Tue Nov 28, 2017 1:17 pm

I'm not able to try this in BRU at the moment but it should work.

RegEx (1)
Match: (\d+). (.*) - (.*)
Replace: \1. \3 - \2
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Relocate text in music filename

Postby blaylok » Tue Nov 28, 2017 2:21 pm

That is so awesome!

Just tried it and it works perfectly!

Thanks so much KenP :D
blaylok
 
Posts: 2
Joined: Tue Nov 28, 2017 8:19 am

Re: Relocate text in music filename

Postby Unindoctrinated » Wed Jan 31, 2018 2:24 am

I want to do exactly the same thing with a folder with 2703 incorrectly formatted songs in it. Unfortunately the answer shown does nothing whatsoever for me. I assume I'm missing a step somewhere.
What am I doing wrong? I tried entering them with and without the leading space in KenP's answer post.

As you can see from the screenshot there is no change to the highlighted file names.

Image

I tried figuring it out for myself but regular expressions might as well be another language.

Any assistance would be much appreciated.
Unindoctrinated
 
Posts: 3
Joined: Wed Jan 31, 2018 1:04 am

Re: Relocate text in music filename

Postby therube » Wed Jan 31, 2018 5:21 am

Assuming that you only have a single dash (-) in the name (actually, in the format, space--space), try this:

1:Regex
Code: Select all
Match:  (.*) - (.*)
Replace:  \2 - \1
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Relocate text in music filename

Postby Unindoctrinated » Mon Feb 05, 2018 7:22 am

That worked perfectly. You're a legend. Thank you very much.
Unindoctrinated
 
Posts: 3
Joined: Wed Jan 31, 2018 1:04 am


Return to Regular Expressions


cron