Page 1 of 1

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

PostPosted: Fri May 21, 2021 8:10 pm
by Ronstang
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

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

PostPosted: Sat May 22, 2021 1:03 am
by Luuk
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

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

PostPosted: Sat May 22, 2021 6:54 am
by Ronstang
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.

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

PostPosted: Sat May 22, 2021 7:51 am
by Luuk
The top "Match" line is not getting copy/pasted properly.

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

PostPosted: Mon May 24, 2021 4:11 pm
by therube
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...