Rearranging mp3 filenames starting with The/A/An

A swapping-ground for Regular Expression syntax

Rearranging mp3 filenames starting with The/A/An

Postby Narcissus » Thu Mar 10, 2016 4:33 am

I am attempting to get my mp3 collection's filenames all the same format, but half of the filenames start with "The" or "A/An". An example is as follows:

Current filename: Michael Jackson - The Way You Make Me Feel.mp3
Desired filename: Michael Jackson - Way You Make Me Feel, The.mp3

What would the proper way to go about this be? Any help is greatly appreciated.
Narcissus
 
Posts: 2
Joined: Thu Mar 10, 2016 4:25 am

Re: Rearranging mp3 filenames starting with The/A/An

Postby Admin » Thu Mar 10, 2016 4:58 am

The , A , An : are they always after - ?
Admin
Site Admin
 
Posts: 1467
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rearranging mp3 filenames starting with The/A/An

Postby Narcissus » Thu Mar 10, 2016 5:01 am

For this particular instance, yes, since I'm addressing the song names right now. After playing with it awhile I think I actually just figured it out.

Match: (.+) - (The) (.+)
Replace: \1 - \3,\2

That seems to have worked from what I can tell.
Narcissus
 
Posts: 2
Joined: Thu Mar 10, 2016 4:25 am

Re: Rearranging mp3 filenames starting with The/A/An

Postby Admin » Fri Mar 11, 2016 1:55 am

Yes, that's correct. You should be able to use also

Match: (.+) - (The|A|An) (.+)
Replace: \1 - \3,\2

that is, match The or A or An after -
Admin
Site Admin
 
Posts: 1467
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions