Make existing settings to also work with filenames *.eng.srt

Bulk Rename Utility How-To's

Make existing settings to also work with filenames *.eng.srt

Postby Ronstang » Fri May 21, 2021 8:10 pm

I have an existing favorite that adds brackets to everything past the date in parenthesis in a filename so:

Frankenstein (1931) TCMHD.mkv
Frankenstein (1931) TCMHD.srt becomes:

Frankenstein (1931) [TCMHD].mkv
Frankenstein (1931) [TCMHD].srt

But now some of my automatically generated files have multiple subs so now they are named:

Frankenstein (1931) TCMHD.Eng.srt
Frankenstein (1931) TCMHD.Spa.srt

And I need the same settings to also add the brackets around the channel identifier for files named with the language identifier added to the filename.

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

Re: Make existing settings to also work with filenames *.eng.srt

Postby Luuk » Sat May 22, 2021 1:03 am

There can be many different ways, but they will depend much on the filename-formats, so if ...

Channel-ID ==== 2-8 Capital letters
Language-ID == 1 Capital letter, then 2-5 lowercase letters
File-Format === "Name (year) Channel-ID.Language-ID.extension (but only sometimes with .Language-ID)

Then could use RegEx(1) with a checkmark in "v2", with a Match and Replace like...
^(.+\(\d{4}\) )([A-Z]{2,8})(\.[A-Z][a-z]{2,5})?$
\1[\2]\3
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm

Re: Make existing settings to also work with filenames *.eng.srt

Postby Ronstang » Sat May 22, 2021 6:54 am

Thank you....but I am obviously doing something wrong since with those parameters BRU reports that RegEx(1) is invalid. I tried copying and pasting and entering it all manually with no difference.
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Re: Make existing settings to also work with filenames *.eng.srt

Postby Luuk » Sat May 22, 2021 7:51 am

The top "Match" line is not getting copy/pasted properly.
Luuk
 
Posts: 691
Joined: Fri Feb 21, 2020 10:58 pm

Re: Make existing settings to also work with filenames *.eng.srt

Postby therube » Mon May 24, 2021 4:11 pm

Another method...

1:RegEx, (checkmark) Simple
Code: Select all
Match:  %1) %2.%3
Replace:  %1) [%2].%3

Match up to the closing parenthesis (of the date)
eat the space
Match up to the next (.) dot (i.e., the channel)
Match everything else (the language & whatever else follows)

Add the spaced back in & the brackets...
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to How-To


cron