Page 1 of 1

Removing text after and including a bracket

PostPosted: Fri Dec 29, 2023 5:18 pm
by DJSolidSnail
Hello.

Basically, I have a folder of films with the name of the film, then in brackets after the director and year, i.e. "2001 - A Space Odyssey (Stanley Kubrick, 1968)". However, this makes it difficult for my Plex media server to match them, so I'm looking to delete the bracketed bit, but I'd rather do this in bulk as it's proving prohibitively time-consuming to do it individually. Is there a way to delete the bracketed bits in bulk?

Also, how do I replace, say, "Deer Hunter, The" with "The Deer Hunter" in bulk, in other words swapping my The's around?

Much obliged.

Remove ending (text)

PostPosted: Sat Dec 30, 2023 1:12 am
by Luuk
To remove the ending (text), RegEx(1) can use a "Match" and "Replace" like...
(.+) \([^()]+\)$
\1

To put "The" at the very beginning, the "Match" and "Replace" can look like...
(.+), (The)(\b.*)
\2 \1\3

Re: Removing text after and including a bracket

PostPosted: Sat Jan 20, 2024 9:47 am
by Gpizano
Ok... so I want to be able to achieve the same thing as the OP, but I cannot for the sake of me, figure out what you are saying in your solution. Could you "dumb it down" for me?

Re: Removing text after and including a bracket

PostPosted: Sun Jan 21, 2024 10:51 am
by Admin
Hi can you give a few renames examples, before and after? thanks

Re: Removing text after and including a bracket

PostPosted: Mon Jan 22, 2024 6:38 pm
by Gpizano
Here are a couple examples:

A-E (1982)(Broderbund)(Side A)[cr Blade].dsk
Beyond Floppy (19xx)(Greg Hale - Ted Cohn)[cr Great Lake Alliance].dsk

So, ultimately I would like to strip out anything between the brackets (including the brackets) but retaining the name and disk extension.
So, the first file would end up being:
A-E.dsk
and the second one would be:
Beyond Floppy.dsk

Thanks for any info you may have!

Re: Removing text after and including a bracket

PostPosted: Tue Jan 23, 2024 1:07 am
by Admin
BRU could truncate everything after the first ' (' ? Would that do it ?

If so, you can use:

RegEx (1)
Enable Simple flag
Match: %1 (%2
Replace: %1

Which means: match some text (%1) followed by a space and parentheses, followed by some more text (%2), then replace all with the first text matched (%1)