Removing a year between parenthesis but not characters

Bulk Rename Utility How-To's

Removing a year between parenthesis but not characters

Postby zahrex » Wed Aug 25, 2021 2:57 pm

I just downloaded BRU and am a bit overwhelmed with all the features but I don't see scanning through posts how to do this:

I have files and folders that have the year in the filename between parenthesis.

Ex #1. Document XYZ (2021) Final Report.doc

There are however ones that have the year and/or characters between parenthesis.

Ex #2. Document ABC (2020) Initial Report (HOLD).doc
or
Ex #3. Document QRS Initial Report (DALE).doc



I'm looking to replace the year with parenthesis with "-" but not do anything with the rest of the name.

Output ( I want):

Ex. #1 Document XYZ - Final Report.doc
Ex. #2 Document ABC - Initial Report (HOLD).doc
Ex #3. Document QRS Initial Report (DALE).doc
zahrex
 
Posts: 4
Joined: Wed Aug 25, 2021 12:53 am

Replace last ' (year) ' ===> ' - '

Postby Luuk » Wed Aug 25, 2021 10:14 pm

To replace only the last ' (year) ' ===> ' - ', can use the RegEx(1) with a 'Match' and 'Replace' like...
(.+ )\((19|20)\d\d\)( .+)
\1-\3
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Removing a year between parenthesis but not characters

Postby zahrex » Wed Aug 25, 2021 11:28 pm

I tried this on my examples and it worked fine!

Thanks for helping me and for replying so quickly too! :)
zahrex
 
Posts: 4
Joined: Wed Aug 25, 2021 12:53 am


Return to How-To