Rename files and folders to remove BRACKETS

Bulk Rename Utility How-To's

Rename files and folders to remove BRACKETS

Postby Ronstang » Tue Feb 09, 2021 9:47 pm

I have a lot of movies in folders that look like this:

C:\Destroy all Monsters! (1968) [TCMHD]+5

...and insider the folders the files are named

Destroy all Monsters! (1968) [TCMHD]+5.mkv
Destroy all Monsters! (1968) [TCMHD]+5.nfo
Destroy all Monsters! (1968) [TCMHD]+5.eng.srt

But I want to change them to the following:

C:\Destroy all Monsters! (1968)

Destroy all Monsters! (1968) - TCMHD+5.mkv
Destroy all Monsters! (1968) - TCMHD+5.nfo
Destroy all Monsters! (1968) - TCMHD+5.eng.srt

Is it possible for me to do this with BRU? I apologize, I love this program but I don't know anything about scripting language and the such so I don't know how to configure the arguments to get the results I want....or if it is possible.

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

Re: Rename files and folders to remove BRACKETS

Postby therube » Tue Feb 09, 2021 10:12 pm

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

Match everything (except for the brackets)
Do not include the brackets in the output (new name)
Instead, add a dash (& space) in place of the opening bracket
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Rename files and folders to remove BRACKETS

Postby Ronstang » Tue Feb 09, 2021 10:21 pm

Thank You...will that remove everything beyond the date in the folders?
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Re: Rename files and folders to remove BRACKETS

Postby Luuk » Wed Feb 10, 2021 12:39 am

Im almost posted just like therube, because not realizing you want the folder names differently! So this can be another way...
Extensions(11) is "Remove"... Then RegEx(1) with checkmarks in "Inc.Ext." and "v2" for this Match and Replace...
(.*) \[(.*)\](.*\..*)(?X)(.+) \[[^.]*$
$1 - $2$3(?X)$1

The first regex is like therubes, except "v2" format.. The next is if folder names not have "." after "[", then to destroy the last " [" and everything else.
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Rename files and folders to remove BRACKETS

Postby Ronstang » Wed Feb 10, 2021 9:06 pm

Luuk wrote:Im almost posted just like therube, because not realizing you want the folder names differently! So this can be another way...
Extensions(11) is "Remove"... Then RegEx(1) with checkmarks in "Inc.Ext." and "v2" for this Match and Replace...
(.*) \[(.*)\](.*\..*)(?X)(.+) \[[^.]*$
$1 - $2$3(?X)$1

The first regex is like therubes, except "v2" format.. The next is if folder names not have "." after "[", then to destroy the last " [" and everything else.


I apologize for being ignorant but I need a little help understanding how this all works because I have no clue about scripting language. Do I have to run both therubes settings and yours or just yours? Also, can I select a folder full of folders and the BRU will rename all the folders and all the files within them. I am new to this and need some help to know how it all works.

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

Re: Rename files and folders to remove BRACKETS

Postby Luuk » Thu Feb 11, 2021 1:02 am

Sorry for the poor explanations. Therubes regex does rename both the folders and files exactly the same, if Filters(12) has checkmark in "Folders".
Im almost posted exactly like him, because thinking its what you want, but he beats me to the finish line, lol.

But when you asked "remove everything beyond date" in the folders? its then revealing the folders to be renamed differently.
So then Im just converting his regex into "v2" format, so I can make two regexs, one for the files, and one for the folders.
With "v2", you can have many regexs separated by (?X), so like... RegEx-1(?X)RegEx-2(?X)RegEx-3

When Im posted, its now looking like only one regex, but its really two of them separated with the (?X) inbetween.
So its ok using mine for both. To conduct everything below a folder, the Filters(12) needs checkmark in "Folders", "Files", and "Subfolder".

Just remember not to forget setting the Extension(11) to "Remove" !!
This because the first regex already matches the extension, so not to invent any double extensions like .ext.ext.

Also, any folder names like "aaa [bbb" get renamed like "aaa" !! So if thats to be any problem, this is better to only rename when "(date)" is just before [text].
(.+\(\d\d\d\d\)) \[(.*)\](.*\..*)(?X)(.+\(\d\d\d\d\)) \[.*\][^.]*$
$1 - $2$3(?X)$1

==========================================================

So if its me, this the exact settings to use ...

RegEx(1) with checkmarks in "v2" and "Inc.Ext." using the Match and Replace...
(.+\(\d\d\d\d\)) \[(.*)\](.*\..*)(?X)(.+\(\d\d\d\d\)) \[.*\][^.]*$
$1 - $2$3(?X)$1

Extension(11) is "Remove"

Filters(12) with checkmarks in "Folders", "Files", and "Subfolder", and the "Mask" is *(*)*[*]*
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Rename files and folders to remove BRACKETS

Postby Ronstang » Thu Feb 11, 2021 2:31 am

Thank you so much!! That worked perfectly and I never would have figured that out on my own. I still don't understand how it works, but I am so thankful that it does because of people like you. I really appreciate your time to explain. :D :D
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am


Return to How-To