#1 2011-04-20 08:49

ozzii
Senior Member
Registered: 2007-07-04
Posts: 101

Rename episodes

Hi,

I have this kind of files.
something.102.something_else
something.1102.something_else

So I would like a rules for changing in this way:
.102. --> .s01e02.
.1102. --> .s11e02.

So if there is 3 digits add s0 before the first one and e before the last 2 digit
If there is 4 digits add just s before the first two and e before the last 2 digit

Thanks in advance.


_________________
Do, or do not. There is no 'try.'" --  Jedi Master Yoda

Offline

#2 2011-04-20 09:31

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Rename episodes

ozzii wrote:

Hi,

I have this kind of files.
something.102.something_else
something.1102.something_else

So I would like a rules for changing in this way:
.102. --> .s01e02.
.1102. --> .s11e02.

So if there is 3 digits add s0 before the first one and e before the last 2 digit
If there is 4 digits add just s before the first two and e before the last 2 digit

Thanks in advance.

Hi,

if your file names are really as your examples,
i.e. the shown digits are the only digits in the whole name,
then this two regex may work:

FROM:
something.102.something_else
something.1102.something_else
TO:
something.s01e02.something_else
something.s11e02.something_else
DO:
--- match four digits
1) RegEx: Replace expression "(\d\d)(\d\d)" with "s$1e$2" (skip extension)
--- match three digits
2) RegEx: Replace expression "(\d)(\d\d)" with "s0$1e$2" (skip extension)


HTH? big_smile

- - -

Just for the record:
i had problems using this regex which should each match three digits only:
RegEx: Replace expression "(\d)(\d\d)\D" with "s0$1e$2" (skip extension) - three digits following by one non-digit sign
RegEx: Replace expression "(\d)(\d\d)\." with "s0$1e$2" (skip extension) - three digits following by an literal dot
So i match first four digits, and then in an second step three digits.
EDIT:
forget it ;-)
i was trapped once again by (skip extension) big_smile
Because remember: all after the first dot is taken as "extension"!
Un-checking "skip extension" solves my problem roll smile


So that is what i was after because the match is more error-save by matching the dots too:

DO:
--- match an dot followed by three digits followed by an dot
1) RegEx: Replace expression "\.(\d)(\d\d)\." with ".s0$1e$2."
--- match an dot followed by four digits followed by an dot
2) RegEx: Replace expression "\.(\d\d)(\d\d)\." with ".s$1e$2."
-- Remember: Un-checking "skip extension" !!!  in your case with so many dots in the file name



Happy ReNaming

Last edited by Stefan (2011-04-20 09:44)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2011-04-20 12:20

ozzii
Senior Member
Registered: 2007-07-04
Posts: 101

Re: Rename episodes

Thanks, I will test this when I'm home and I keep you informed.


_________________
Do, or do not. There is no 'try.'" --  Jedi Master Yoda

Offline

#4 2011-04-20 16:44

ozzii
Senior Member
Registered: 2007-07-04
Posts: 101

Re: Rename episodes

It's working.
Thanks Stefan


_________________
Do, or do not. There is no 'try.'" --  Jedi Master Yoda

Offline

#5 2011-04-20 19:48

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Rename episodes

Thanks for the feedback ! ;-)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB