Copy from parenthesis in one field (title) to a different field (composer)

I would like to copy from the title to the composer field in the following manner.

Look in the title for "Remix", "Bootleg", "Edit", "Mashup" and take the artists involved and copy them to the composer tag.
The artists are always in parenthesis. Also ignore any words after the words "Remix", "Bootleg", "Edit", "Mashup".

Case examples:

Case 1: Remix
Title: Cold (ft Future) (R3hab & Khrebto, KSHMR Remix)
Composer: R3hab & Khrebto, KSHMR

There is an exception to the above. If the word "Extended" is before Remix, disregard it.
Exception:
Title: Cold (ft Future) (R3hab & Khrebto, KSHMR Extended Remix)
Composer: R3hab & Khrebto, KSHMR

If its difficult to create a script to disregard the "Extended", then please ignore it.

Case 2: Mashup
Title: Tiesto & The Chainsmokers Vs Eminem (WhiteBeats vs Beats Mashup New)
Composer: WhiteBeats vs Beats

Case 3: Bootleg
Title : ON YOUR MARK vs. BALADA (Yegor Vasutin, Beats Bootleg 2020)
Composer: Yegor Vasutin, Beats

Case 4: Edit
Title: Show Me The Omnislash (KSHMR Edit 2020)
Composer: KSHMR

There is an exception regarding edit. This would be when in a title there's only (Radio Edit). In this case, the script shouldn't perform any action, as Radio Edit wouldn’t refer to any artist.
Example of exception:
Title: I'm Not Over (Radio Edit)
Composer:

For the basic copy try an action of the type "Format value" for COMPOSER
Format string: $replace($regexp(%title%,'.*\) \((.*)\)',$1), Remix,, Radio,, Extended,, Bootleg,, Edit,)

But I feel unable to deal with "Radio Edit" and tracks with text like "Mashup New" (which was not in your initial list).
Please have in Mind that MP3tag cannot read and only react to patterns.
So it is virtually impossible to distinguish between KSHMR Edit and Radio Edit.
Just as in
Time flies like an arrow
Fruit flies like a banana
(where is subject, predicate and object?)
I would copy the data first and then see if there are any strange ones and then delete these fields again.

Thank you for the reply and the explanation. Understood.

Ok, so a revised need would be similar to above, basically without catching the exceptions:

Case 1: Remix
Title: Cold (ft Future) (R3hab & Khrebto, KSHMR Remix)
Composer: R3hab & Khrebto, KSHMR

Case 2: Mashup
Title: Tiesto & The Chainsmokers Vs Eminem (WhiteBeats vs Beats Mashup)
Composer: WhiteBeats vs Beats

Case 3: Bootleg
Title : ON YOUR MARK vs. BALADA (Yegor Vasutin, Beats Bootleg)
Composer: Yegor Vasutin, Beats

If any of the words, "Remix", "Bootleg", "Edit", "Mashup", are not found in the title, then for the script to not perform any action.

Exclude "Edit"

My suggestion does nothing more than to get the contents of the last parenthesis pair and then replace the listed words with nothing.
I think you can adapt that list so that it fits.

I edited the string to:
$replace($regexp(%title%,'.) ((.))',$1), Remix,, Mashup,, Extended,, Bootleg,)

In case 2&3 above I get in the composer field:
Tiesto & The Chainsmokers Vs Eminem (WhiteBeats vs Beats)
ON YOUR MARK vs. BALADA (Yegor Vasutin, Beats Bootleg)
In both cases the title is also copied to the composer field

In case 1: Cold (ft Future) (R3hab & Khrebto, KSHMR Remix)
I get correctly: R3hab & Khrebto, KSHMR

I tried it on other files also: i.e.
title: Jello (R3hab Remix) and get in the
composer field: Jello (R3hab)
which includes the title

In cases where the release is not a remix, mashup or bootleg, then the title is copied. I would like to avoid this.
Example, I tried it on:
title: House Of Cards
Composer: House of Cards

Could you please explain what you mean by pair?

As I said: it takes the last pair of opening an closing brackets - and having said that, it implies that there is a "first" pair of them.
Due to the greadiness of the * repeater, an expression like `((.*)) would include everything in brackets, with source
Cold (ft Future) (R3hab & Khrebto, KSHMR Remix)
the result would be
(ft Future) (R3hab & Khrebto, KSHMR Remix)

To be honest: use my suggestion on the files that have a closing and an opening bracket close to each other : ) (
that should work.
For all the other files that have only a single pair of brackets, use
Format string: $regexp(%title%,'.* \((.*)\)',$1)
and then replace every word that you don't want with nothing using a simple replace action (i.e. delete it).

Why is all this so tricky?
The data in the field TITLE is not only the title but also contains a featured artist and a version description.
Unfortunately, the ID3 standard does not offer dedicated fields to structure this data.
The brackets are no proper field separators as one cannot tell from the brackets what kind of data they separate from the rest.
I, personally, use <> to enclose the featured artist and [ ]to enclose the version.
This leaves the round brackets for the title data.
And with these separating, dedicated markers, it is much easier to get the required piece of data from the title string.
So coming back to the thread in


it might have been better to use other brackets than the round ones to add the featured artist.

1 Like

Thank you for the long explanation and the recommendation.

I will follow your suggestion of enclosing in different brackets so that the only remixes/bootlegs/mashups, stay in parenthesis. This will be useful also, as I would also want to separate the various release types in the Grouping tag (that would be my next forum post). I will get back soon as soon as I edit my current actions.

I edited my actions so now my titles are in the following format:

Cold "<"ft Future">" (R3hab & Khrebto, KSHMR Remix)
Result: R3hab & Khrebto, KSHMR

Tiesto & The Chainsmokers Vs Eminem (WhiteBeats vs Beats Mashup)
Result: WhiteBeats vs Beats Mashup

ON YOUR MARK vs. BALADA (Yegor Vasutin, Beats Bootleg)
Result: Yegor Vasutin, Beats

House Of Cards [Original Mix]
Result: No action

Heaven "<"ft Delaney Jane">" [Extended Mix]
Result: No action

I tried editing the scripts above without success.

P.S I used quotes for < and > as otherwise they don't show up in the post

Anything that you don't want get formatted enclose in accent-grave (top left to bottom right)
If the pattern is right now "any text (composer text)"
try
Format string: $replace($regexp(%title%,'.* \((.*)\)',$1), Remix,, Radio,, Extended,, Bootleg,,)

Thank you.

I decided to make a small edit to make it even more organized and clear, using your idea from before.

All titles that include the word "Remix", "Mashup" or "Bootleg" are now enclosed in { }

I used the following format string found in another thread:
$regexp(%TITLE%,'(([^(]\b(?:remix|live|mix|edit)\b[^)]))','[$1]',1)
which I edited.

Now the titles are formatted in the following way:

Case 1:
Title: Care
Result: no copying action performed
(this is just the title name without any text appended)

Case 2:
Title: Care [Extended Mix]
Result: no copying action performed

Case 3:
Title: Care [Extended Mix]
Result: no copying action performed

Case 4:
Title: Cold {R3hab & Khrebto Remix}
Composer: R3hab & Khrebto

Case 5:
Title: SHIVA (Sunburn 2017 Anthem) {KSHMR,Rehab Mashup}
Result: KSHMR

So basically pickup { } only and move to the composer field. If there is no { }, then don't perform any action.

This way everything will be more organized.

Could you help for the above?.

Edit:
An easier way would be, if there's { } in the title, to copy the whole { } and any text enclosed to the composer field - then use a replace action to remove the { } and the words, mashup/remix/bootleg

I found this thread:

but I wasn't able to adapt any of the solutions.

Could you show us what you tried?
It is much easier to build an existing attempt than to start from scratch.

I have tried editing the following from the previous thread, replacing the ( ) with { } without success

2.1.
Action #1
Actiontype 7: Import tag fields (guess values)
Source format __: $replace(%TITLE%,'(','((')
Guessing pattern: %DUMMY% (%COMMENT%

2.2.
Action #1
Actiontype 7: Import tag fields (guess values)
Source format __: $replace(%TITLE%,'(','((',')','))')
Guessing pattern: %DUMMY% (%COMMENT%)

If you want to replace round brackets (a text constant) with another character, here the { then this is a simple replace action.
A "Guess value" action is intended to assign parts of a string to a pattern of fields. So I doubt that "Guess value" will be of benefit.
Create an action of the type "Replace" for TITLE
Search string: (
Replace string: {

and an equivalent for the closing brackets

I'm not trying to replace round brackets with another character.

As posted above, initially I was trying to move all the artists of a remix,mashup,bootleg:
i.e. (R3hab & Khrebto, KSHMR Remix)
from the title to the composer field
i.e. R3hab & Khrebto, KSHMR

Thereafter, I decided to formatted all the titles so that if its a remix, mashup or bootleg, then the artists involved are formatted in curly brackets { } instead of ( ). So that extracting the artists would be easier.

So now, what I'm trying to do is - if in the title field there's curly brackets { }, extract the contents to the composer field. If there's no curly brackets { } in the title, don't copy anything to the composer field.