Let's say I have a Filename:
ThisIsTheFile (xxxxxxxxx).docx
But, I want to delete only the section of the Filename in parentheses, that is, (xxxxxxxxx).
How do I do this?
Thanks!
[b]Admin wrote:There are different ways to do this:
Replace (3)
Replace: (*) <---- (*) with a space in front.
Match: <--- replace with nothing = remove it ~~~~~~~~~~~~~YES, THIS WORKED!
RegEx (1):
Match: \(.*\) <---- \(.*\) with a space in front.
Replace: <--- replace with nothing = remove it~~~~~~~~~~~~~Actually, I didn't test this one
RegEx (1): with Simple Flag Enabled
Match: %1 (%2)
Replace: %1~~~~~~~~~~~~~YES, THIS WORKED!
Remove (5)
Crop: Special -> (*) <---- (*) with a space in front.~~~~~~~~~~~~~NO, THIS DID NOT WORK! (Wish I could show an image without having to insert from http)
File Segment + Name (2)
File segment -> From set to ( <----- a ( with a space in front
and
Nme (2) -> Remove~~~~~~~~~~~~~I did not test this one. For any one file, I would just highlight the segment and delete it.
Javascript Function
// Find the position of the opening and closing parentheses
openParenIndex = name.indexOf(' (');
closeParenIndex = name.indexOf(')');
// If both parentheses are found, remove the part inside them
if (openParenIndex !== -1 && closeParenIndex !== -1) {
newName = name.substring(0, openParenIndex) + name.substring(closeParenIndex + 1);
}~~~~~~~~~~~~~YES, THIS WORKED! But, presumably, the script cannot be saved; it must be done each time.[/b]