Removing leading and trailing spaces from content inside brackets


#1

Hello!

I have several files named in this fashion:

After the Fire - Der Kommisar ( 12'' Extended remix ).mp3

Arrow - Hot hot hot ( Original extended version ).mp3

Book of Love - I touch roses ( Long stemmed version ).mp3

I want to remove leading and trailing spaces from content inside brackets in order to rename files like this:

After the Fire - Der Kommisar (12'' Extended remix).mp3

Arrow - Hot hot hot (Original extended version).mp3

Book of Love - I touch roses (Long stemmed version).mp3


I know this could be bloody easy to achieve but it's one of those mornings that i just can't figure out how.

Thank you in advance for your attention! :slight_smile:


#2

You may code something like this:
$replace('After the Fire - Der Kommisar ( 12'' Extended remix ).mp3','( ','(',' )',')')

DD.20080918.1627.CEST


#3

Yes but i had to make that for every single file right?


#4

I've sorta figured out and it worked.

I've used the Replace (Filename -> Filename) in this fashion:

Old filename pattern:

%1 - %2 ( %3 )

New filename pattern:

%1 - %2 (%3)

The boring part was that i had to select all the files by hand in order to satisfy the condiotional.