Changing leading 'The' in a song filename to ', The'

Bulk Rename Utility How-To's

Changing leading 'The' in a song filename to ', The'

Postby Steve Bannister » Wed Jan 05, 2022 12:52 pm

Happy New Year, all.

I have tried searching for an answer to this on the forum but I can't find one.

I am trying to change/move 'The' from the Artist of a song filename to ', The' at the and of the Artist name but before the ' - ' separator.

For example; 'The Cars - Drive' becomes 'Cars, The - Drive'

As I need to do over a thousand of these (the idea of 'Bulk'), I can't just insert ', The' at a defined position as this position would be different in different filenames. I need to insert it before the ' - ' separator.

For example;
The Browns - The Three Bells
The Buzzcocks - Ever Fallen In Love

becomes;
Browns, The - The Three Bells
Buzzcocks, The - Ever Fallen In Love

Thank you in advance for any ideas.
Steve Bannister
 
Posts: 6
Joined: Wed Jan 05, 2022 12:40 pm

Re: Changing leading 'The' in a song filename to ', The'

Postby Steve Bannister » Wed Jan 05, 2022 12:59 pm

I'm thinking that it's easier to remove the first four characters of each file ('The ') first, and then insert ', The' before the ' - ' separator. That would help with removing the word 'The' from other parts of the file name if it occurs somewhere else and make any code easier. Am I right?
Steve Bannister
 
Posts: 6
Joined: Wed Jan 05, 2022 12:40 pm

The Artist Name - Song Name ======> Artist Name, The - Song

Postby Luuk » Wed Jan 05, 2022 8:51 pm

One way, is first putting a checkmark inside of Filters(12) for 'RegEx', and then a 'Mask' like ^The .* - .*
Then to click the blue-arrows beside 'Mask', so this will only present files that do look like the examples.
Remove(5) can then destroy the first 4-characters, and Replace(3) could replace \first\ - ===> , The -
(or also Remove(5) could just put a checkmark inside of 'First' instead of typing '\first\')

Another way with less settings, is just using the RegEx(1) with a 'Match' and 'Replace' like...
^(The) (.+?)( - .+)
\2, \1\3

The Browns - The Three Bells.mp4 ============> Browns, The - The Three Bells.mp4
The Buzzcocks - Ever Fallen In Love.mp4 =======> Buzzcocks, The - Ever Fallen In Love.mp4
The Monkeys do eat the bananas.mp4 =========> (not renamed, because no " - " separator for Artist Name)
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Changing leading 'The' in a song filename to ', The'

Postby Steve Bannister » Mon Jan 17, 2022 9:42 am

Hi Luuk,

Thank you for your fix, and sorry for my late reply as I work away and I'm not always home. Your RegEx fix works perfectly as is exactly what I needed. Thank you for taking the time to help. Brilliant.

Thanks again,

Steve
Steve Bannister
 
Posts: 6
Joined: Wed Jan 05, 2022 12:40 pm


Return to How-To