Remove all before -S01E10- and replace with 10. then a space

Bulk Rename Utility How-To's

Remove all before -S01E10- and replace with 10. then a space

Postby Ronstang » Tue Oct 10, 2023 11:30 pm

The title is pretty explanatory. I want to take a file like this:

Mission Impossible-S01E10-The Carriers.mkv

And have the result look like this:

10. The Carriers

I would like it to do this for anything in this confuguration using the episode number by itself with a period and then a space and if possible the 0-9 I prefer 1. 2. instead of 01. 02. etc.

Thanks
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Keep episode's significant digits inside of -S##E0#-

Postby Luuk » Wed Oct 11, 2023 9:13 am

With RegEx(1) the "Match" and "Replace" can be like...
.+-S\d+E0*(\d+)-(.+)
\1. \2

Mission Impossible-S01E2-Memory ------------> 2. Memory
Mission Impossible-S01E08-The Ransom -----> 8. The Ransom
Mission Impossible-S01E10-The Carriers ----> 10. The Carriers
Mission Impossible-S02E00001-The Widow ---> 1. The Widow
Mission Impossible-S02E00016-The Spy ------> 16. The Carriers
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: Remove all before -S01E10- and replace with 10. then a space

Postby Ronstang » Wed Oct 11, 2023 4:58 pm

Thanks so much Luuk, perfect as always! What kind of modification to that would I need if there are no hyphens like this:

Mission Impossible S01E2 Memory

Because different software names these things differently some put hyphens and some do not.

Thanks as always :D
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Keep episode significant digits if S##E## bordered by -/spac

Postby Luuk » Wed Oct 11, 2023 6:04 pm

Inside of the "Match", can change both "-" ==> "[- ]" to say "either 1-dash or 1-space"...
.+[- ]S\d+E0*(\d+)[- ](.+)
\1. \2
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: Remove all before -S01E10- and replace with 10. then a space

Postby Ronstang » Thu Oct 19, 2023 2:05 am

Thanks Luuk....that last one worked but it made all letters capitalized? Did I copy something wrong?
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Keep episode significant digits, if S##E## bordered by -/spa

Postby Luuk » Thu Oct 19, 2023 3:17 am

The RegEx(1) wont capitalize, unless adding \U or \u inside of the "Replace" ??
So its probably just Case(4) using "Upper" inside for its drop-down list ??
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To