#1 2013-04-05 18:51

Dirk
Member
Registered: 2013-04-05
Posts: 91

Remove all signs after "_" followed by a numeral?

How can I archieve to remove all the signs after the first combination of the first "_" and the first numeral, e.g. "_1" including removing this combination? And: this first combination ("_" and one numeral, e.g. "_1": "_1") always is followed by a dot (e.g. "_1.") or by a numeral followed by a dot (e.g. "11."), so if it is like that this combination and the rest of the file name shall be removed.

Offline

#2 2013-04-05 19:16

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

Re: Remove all signs after "_" followed by a numeral?

Hi Dirk, welcome!

You have to find a common rule matching all your different files.

Please provide five example name and how they should look after the modification.

FROM:
file namea_1.text.ext
file nameb_12.text.ext
TO:
file namea.ext
file nameb.ext

Please provide mostly real names and no funny examples, and be sure to show mostly all possibilities if you have different file names.


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 2013-04-05 19:39

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Remove all signs after "_" followed by a numeral?

Thank you very much, Stefan.

Please provide five example name and how they should look after the modification.

James_Band_007_Der_Abend_stirbt_nie_13.03.29_20-15_atv_140_TVOF_XX.mpg.avi
Das_Haus_der_Diener_13.03.27_22-00_siyy_100_TVOF_XX.mpg.avi
Im_Netz_13.03.27_20-15_art_90_TVOF_XX.mpg.avi
True_Lies_Wahre_Luegen_13.03.27_22-40_kabe21_170_TVOF_XX.mpg.avi
Transsib0rian_13.03.18_21-55_arte_115_TVOF_XX.mpg.avi
Das_Zusuki_Kartell_No_Way_Back_13.03.18_01-20_ort1_85_TVOF_XX.mpg.avi

James Band - 007 - Der Abend stirbt nie.avi
Das Haus der Diener.avi
Im Netz.avi
True Lies - Wahre Luegen.avi
Transsib0rian.avi
Das Zusuki Kartell - No Way Back.avi

(I assume the "-" or other characters instead of the "-" will not be possible to add automatically)

These files names shall be found by scrapers to get some more information about these movies.

There sometimes might be numbers showing the part of a movie,
e.g. Die Hard 2 (Die_Hard_2 followed by the "_" and numerals like it is in the examples below,
that is why I tried to use the dot in the rule, trying not to remove a number belonging to the movie name)

Wild_Things_2_13.03.02_23-50_puls5_105_TVOF_XX.mpg.avi
Nummer_23_13.03.03_22-30_pro8_115_TVOF_XX.mpg.avi
American_Psycho_2_Der_Horror_geht_weiter_12.08.24_23-55_tele6_110_TVOF_XX.mpg.avi
Terminator_2__Tag_der_Abrechnung_12.08.24_22-15_atv_160_TVOF_XX.mpg.avi

Last edited by Stefan (2013-04-05 21:56)

Offline

#4 2013-04-05 22:02

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

Re: Remove all signs after "_" followed by a numeral?

OK, the rule is:
find first occurrence of "a underscore"+"two digits"+"a dot" and remove this including the remaining till the end  =>  "_\d\d\..+"


FROM:
James_Band_007_Der_Abend_stirbt_nie_13.03.29_20-15_atv_140_TVOF_XX.mpg.avi
True_Lies_Wahre_Luegen_13.03.27_22-40_kabel2_170_TVOF_XX.mpg.avi
Wild_Things_2_13.03.02_23-50_puls4_105_TVOF_XX.mpg.avi
American_Macho_2_Der_Humor_geht_weiter_12.08.24_23-55_tele6_110_TVOF_XX.mpg.avi

TO:
James Band 007 Der Abend stirbt nie.avi
True Lies Wahre Luegen.avi
Wild Things 2.avi
American Macho 2 Der Humor geht weiter.avi

USE:
1) RegEx: Replace expression "_\d\d\..+" with "" (skip extension)
2) Replace: Replace all "_" with " " (skip extension)

Dirk > (I assume the "-" or other characters instead of the "-" will not be possible to add automatically)
This is right.


HTH?


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

#5 2013-04-05 22:23

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Remove all signs after "_" followed by a numeral?

Many thanks, Stefan,

Works perfectly.

If there might occur these kind of file names having just one digit followed by a dot instead of the two digits followed by a dot, e.g.

James_Band_007_Der_Abend_stirbt_nie_1.03.29_20-15_atv_140_TVOF_XX.mpg.avi
instead of
James_Band_007_Der_Abend_stirbt_nie_13.03.29_20-15_atv_140_TVOF_XX.mpg.avi

what would I have to enter instead of
1) RegEx: Replace expression "_\d\d\..+" with "" (skip extension)

Yes, it helps, indeed.

Many thanks, again.

Offline

#6 2013-04-05 22:46

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

Re: Remove all signs after "_" followed by a numeral?

Now you have provided that many examples and still missed an important part.
OK, once again:

To match one OR two digits use

_\d{1,2}\..+


James_Band_007_Der_Abend_stirbt_nie_1_1.03.29_20-15_atv_140_TVOF_XX.mpg.avi
James_Band_007_Der_Abend_stirbt_nie_2_13.03.29_20-15_atv_140_TVOF_XX.mpg.avi
TO:
James Band 007 Der Abend stirbt nie 1.avi
James Band 007 Der Abend stirbt nie 2.avi
USE:
1) RegEx: Replace expression "_\d{1,2}\..+" with "" (skip extension)
2) Replace: Replace all "_" with " " (skip extension)


BTW, maybe you are able to help Denis too? See my footer if yes.


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

#7 2013-04-08 11:44

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Remove all signs after "_" followed by a numeral?

<<<Now you have provided that many examples and still missed an important part.
Yes, sorry, but it didn't seem to be enough..actually, I do not know, whether such names might occur, but...I mean to remember to have seen it somewhere...

Great, perfect again.

<<<BTW, maybe you are able to help Denis too? See my footer if yes.
Oops, three items there, I assume, it is the donate one...

Many thanks again.

Offline

Board footer

Powered by FluxBB