S1 E1 CHANGE To -> Season 1 - Episode 1

A swapping-ground for Regular Expression syntax

S1 E1 CHANGE To -> Season 1 - Episode 1

Postby Guy » Mon Feb 13, 2023 10:49 am

Hi,

Should rename many episodes of "Supernatural" tv show from the below default form to the new better names, What're RE commands:

Note: The below example of default shows for season 1 (S 1 E 1), for next seasons; the numbers in front of "S" change to 2, 3, 4, ... for the next seasons.

Defulat:
Supernatural S1 E1

Wished:
Supernatural - Season 1 - Episode 1 =

Thank you
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: S1 E1 CHANGE To -> Season 1 - Episode 1

Postby therube » Mon Feb 13, 2023 6:15 pm

3:Replace
Code: Select all
Replace:  S1|S2|S3|E1|E2|E3
With:  Season 1|Season 2|Season 3|Episode 1|Episode 2|Episode 3

You could do something like that. Just extend out as needed.


Otherwise, I suppose you could do it with 1:RegEx, but that would take more thought ;-).
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: S1 E1 CHANGE To -> Season 1 - Episode 1

Postby Guy » Mon Feb 13, 2023 7:22 pm

therube wrote:3:Replace
Code: Select all
Replace:  S1|S2|S3|E1|E2|E3
With:  Season 1|Season 2|Season 3|Episode 1|Episode 2|Episode 3

You could do something like that. Just extend out as needed.


Otherwise, I suppose you could do it with 1:RegEx, but that would take more thought ;-).



Replace/With function can be helpful for "S -> Season (X)" because the number for the season is similar for all episodes, but when it comes to episode numbers, it fails, because each episode has its own specific number and can't rename a bunch of files at once and it's a confusing way. Just need Regex commands to rename those huge episodes cleanly and quickly.
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: S1 E1 CHANGE To -> Season 1 - Episode 1

Postby Admin » Mon Feb 13, 2023 10:58 pm

RegEx (1) Enable Simple

Match: %1 S%2 E%3
Replace: %1 - Season %2 - Episode %3

Try this however there could be issues if there are words starting with S or E.
Might need a more complex regex that matches digits only.
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: S1 E1 CHANGE To -> Season 1 - Episode 1

Postby Guy » Tue Feb 14, 2023 8:44 am

Admin wrote:RegEx (1) Enable Simple

Match: %1 S%2 E%3
Replace: %1 - Season %2 - Episode %3

Try this however there could be issues if there are words starting with S or E.
Might need a more complex regex that matches digits only.



Well done Admin!, That regex renamed my files as I expected without problems. :D
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am


Return to Regular Expressions


cron