Remove all ( ) and characters within

A swapping-ground for Regular Expression syntax

Remove all ( ) and characters within

Postby earthprime » Wed Jun 03, 2015 8:49 pm

Hi everyone. I have a folder with 1000+ files. Most are similar to the following:

File_Name (additional info).txt

I can't seem to find the right combination for Bulk Rename to find all brackets ( ) and remove both the brackets and contents within, so my file looks like this:

File_Name.txt

Can anyone assist? Thank you!
earthprime
 
Posts: 3
Joined: Wed Jun 03, 2015 8:44 pm

Re: Remove all ( ) and characters within

Postby Stefan » Wed Jun 03, 2015 9:53 pm

 

From CURRENT:
File_Name (additional info).txt

To WANTED:
File_Name.txt

TRY:
Remove(5) , Crop , Special:  (*)      


- - -

Help wrote:Removals - Remove parts of a filename

This section consists of four separate facilities for removing parts of a filename. Note that these do not apply to the file extension, just the name.

· First n chars - Remove the first n characters from the name. E.g. removing the first 2 characters from "Joe Public.txt" will result in "e Public.txt"
· Last n chars - Remove the last n characters from the name. E.g. removing the last 2 characters from "Joe Public.txt" will result in "Joe Publ.txt"
· From n to n. This allows you to remove a string of text, e.g. from the 6th to the 9th characters.
· Chars - Remove occurrences of characters from the name. E.g. typing "QW:#" will result in all occurrences of Q, W, colon and hash being removed.
· Words - Remove occurrences of words (separated by spaces)
· Crop - Remove any text which occurs before (or after) a specific character or word. See below.
· Digits - Remove all occurrences of the digits 0-9 from the filename.
· Chars - Remove all characters
· Sym - Remove all symbols
· High - Remove high-ASCII characters (chars from 128 to 255)
· Trim - Remove leading and trailing spaces
· D/S - Remove occurrences of double spaces, and replace them with single spaces
· Lead Dots - remove the . or .. from the front of filenames (useful if you've copied from a Linux/Unix system).

When you use the "crop" option, you have the option of specifying a "special" value using the wildcard (*).
This will remove the specified string, and any characters occupied by the wildcard.
So for example, specifying [*] would convert "Hello[ABC] Joe" to just "Hello Joe", as it has removed the two square brackets and everything between.




 
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Remove all ( ) and characters within

Postby earthprime » Wed Jun 03, 2015 11:09 pm

Thank you, worked like a charm! Thank you also for the HELP reference.

After the rename, I've found some files have an additional SPACE before the extension, such as:

FileName .txt

I tried to use the REPLACE feature to replace:

[space].txt
-with-
.txt (no space)

but nothing happened. Do you also have a recommendation for fixing this file name? Thanks.
earthprime
 
Posts: 3
Joined: Wed Jun 03, 2015 8:44 pm

Re: Remove all ( ) and characters within

Postby earthprime » Thu Jun 04, 2015 12:22 am

Disregard, I figured it out!

In the BRU GUI you find this at Remove(5) > [ ]Trim.
Click on Trim and press F1-key to read an short description about the function.
earthprime
 
Posts: 3
Joined: Wed Jun 03, 2015 8:44 pm


Return to Regular Expressions