How to workaround with duplicates in filename?

Have mp3s (around 10000+ files) which have duplicates.

All the files I am talking about are in this format,

01 - Artist 1 - Title (Artist 2 Remix) (Artist 2 Remix).mp3

want duplicate texts to be removed from each mp3 file so that the final mp3 looks like this:
01 - Artist 1 - Title (Artist 2 Remix).mp3

One common condition in all the mp3 is that the DUPLICATE TEXT is always inside ( & ). I can do replace for most cases like (Original Mix) (Original Mix) > (Original Mix) and so on...but I want to know if there exists more professional solution to remove duplicates that are within ( ).

Thanks and best regards.

_FILENAME <== $regexp(%_filename%,'^(.+)(\s\(.+\)){2}$','$1$2')

The above regexp does not check for identical content within the round brackets.

The following regexp does respect identical content within the round brackets.

_FILENAME <== $regexp(%_filename%,'^(.+?)(\s\(.+?\))\g{-1}$','$1$2')


Thanks :slight_smile:

But I really dont know how to apply that regex code. Please help.

P.S. Please excuse me, I tried the FORMAT VALUE, and it worked flawlessly. Just genius.

Thanks a lot sir. :slight_smile:

EDIT 2: One problem though.

If mp3 is in this format it dont work sir.
01 - Artist 1 - Title (Artist 2 Remix) (Feat. Artist 3) (Artist 2 Remix).mp3

Will it be possible to get this sir,
01 - Artist 1 - Title (Artist 2 Remix) (Feat. Artist 3).mp3

Means many mp3s have texts in between the two brackets such as featuring artists.

_FILENAME <== $regexp(%_filename%,'^(.+?)(\s\(.+?\))(\s\(.+?\))\g{-2}$','$1$2$3')

Hmm, ...
why don't you create the filenames fresh from the tag fields?


it worked :smiley:

The problem is that the data is same in the tags or else I would have done TAGS>FILE NAME earlier sir.