New file excludes original name after certain character?

Advanced Renamer forum
#1 : 17/10-21 05:33
Anon
Anon
Posts: 3
Hello. I have a batch of files to rename. All of them are formatted like so;

[Abc] Name (Xyz) {Unwanted Text}

I'd like to rename them all, removing the part within {curly brackets}. Anyone know how I can go about this? Substring is close, but I need to end at the first instance of a Curly Bracket instead of just at a static end point.


17/10-21 05:33 - edited 17/10-21 05:35
#2 : 17/10-21 12:08
David Lee
David Lee
Posts: 1125
Remove pattern...
Pattern: " *{.*"
Use regular expressions.

Do not include the quotes and note that the pattern begins with a space.

This will remove any leading spaces followed by "{" and any remaining characters.

I'm assuming that the curly brackets are actually part of the filename.

Otherwise, to remove everything following "(" you can use...

Remove...
Remove count: "."
Starting at: "("
Apply to: "Name and extension"


17/10-21 12:08 - edited 17/10-21 12:17
#3 : 17/10-21 20:32
Anon
Anon
Posts: 3
Reply to #2:

Thanks! That worked perfectly. I did overlook the other methods like that. How can I do that but with an opening "(" next? It doesnt seem to count " *(.*" as valid.


17/10-21 20:32
#4 : 18/10-21 07:53
David Lee
David Lee
Posts: 1125
Reply to #3:
That's because "(" has a special meaning in a regex. It has to be "escaped" with "\" in order to represent itself - ie "\("

So " *\(.*" will be a valid expression.

However this will remove everything after the first instance of "(".

To remove only the final parenthesized string use the regex: " *\([^\)]*\)$"


18/10-21 07:53
#5 : 22/10-21 19:56
Anon
Anon
Posts: 3
Reply to #4:

That's perfect! Thank you for the very helpful tips!


22/10-21 19:56