How to swap and delete a field in a file name?

Post any Bulk Rename Utility support requirements here. Open to all registered users.

How to swap and delete a field in a file name?

Postby heartradiousa » Fri Jun 05, 2020 9:38 pm

I need an expression to take this file name 1. Song Title-Artist Name-Album Title.mp3 and do the followng
1. i need to remove the number and period, this number could be 2 digits sometimes
2. Move the Artist Name to the front
3. Put a space with a dash between the artist name and song title like this "Artist Name - Song Title
4. Delete the Album Title

so the final out put reads like this Artist Name - Song Title.mp3
heartradiousa
 
Posts: 19
Joined: Thu Mar 01, 2018 11:38 pm

Re: How to swap and delete a field in a file name?

Postby RegexNinja » Sat Jun 06, 2020 4:27 am

For the example given, this expression does it:

^\d{1,2}\. *([A-Z][^-]+)-([A-Z][^-]+)-[A-Z][^-]+$
\2 - \1

Beware: It removes any/all text after a 2nd-hyphen (if beginning with Uppercase), use with caution.
Song-Titles or Artist-Names with hyphens in them would spell disaster.
As a minor precaution, it wont touch names with more than 2-hyphens.
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: How to swap and delete a field in a file name?

Postby heartradiousa » Sat Jun 06, 2020 1:18 pm

it is not working here is a sample

1. My Praise-Phillips, Craig & Dean-let your glory fall.mp3

this should now read after the rename

Phillips, Craig & Dean - My Praise.mp3

the third field -let your glory fall is the album title i need removed
heartradiousa
 
Posts: 19
Joined: Thu Mar 01, 2018 11:38 pm

Re: How to swap and delete a field in a file name?

Postby RegexNinja » Sat Jun 06, 2020 1:59 pm

For the 2-examples given, this expression does it:

^\d{1,2}\. *([A-Z][^-]+)-([A-Z][^-]+)-[A-Za-z][^-]+$
\2 - \1
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: How to swap and delete a field in a file name?

Postby heartradiousa » Sat Jun 06, 2020 2:51 pm

this is working for some but like it did not work either of the following examples

Step By Step-Rich Mullins-songs .mp3 or Step By Step - Rich Mullins - songs .mp3 (notice this spaces in the dashs)
heartradiousa
 
Posts: 19
Joined: Thu Mar 01, 2018 11:38 pm

Re: How to swap and delete a field in a file name?

Postby RegexNinja » Sat Jun 06, 2020 3:41 pm

Per the last 2-examples, leading-digits are no longer mandatory.
For the 4-examples given, this expression does it:

^(?:\d{1,2}\. )*([A-Z][^-]+?) *- *([A-Z][^-]+?) *- *[A-Z a-z][^-]+$
\2 - \1

Results:
1. My Praise-Phillips, Craig & Dean-let your glory fall ----> Phillips, Craig & Dean - My Praise
1. Song Title-Artist Name-Album Title ---------------------> Artist Name - Song Title
Step By Step-Rich Mullins-songs ----------------------------> Rich Mullins - Step By Step
Step By Step - Rich Mullins - songs -------------------------> Rich Mullins - Step By Step
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: How to swap and delete a field in a file name?

Postby heartradiousa » Sat Jun 06, 2020 6:18 pm

I understand what your saying its working with most but not for all here is an example that did not work what change just curious?
5. It Is Well With My Soul-Avalon-faith- a hymns collection [bonus track].mp3
heartradiousa
 
Posts: 19
Joined: Thu Mar 01, 2018 11:38 pm

Re: How to swap and delete a field in a file name?

Postby trm2 » Mon Jun 08, 2020 8:36 pm

You have not been abandoned. RegexNinja wanted me to let you know that if he is not responding, he is having serious internet problems and does know when
they will be resolved. Hopefully another contributor will step in and answer your questions.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: How to swap and delete a field in a file name?

Postby heartradiousa » Fri Jun 26, 2020 9:44 pm

I have completed my project except for the following So I need a scrip to look for the group of numbers in the bracket and they need to be removed Sanctus Real - On Fire [1592226] to have the final output look like this Sanctus Real - On Fire can you please assist

I have gotten my Project completed and this is the final step and wish to thank every for all the help you you have given me we have sorted over 35,000 tracks of music.

thanks
heartradiousa
 
Posts: 19
Joined: Thu Mar 01, 2018 11:38 pm


Return to BRU Support