Copy and delete "featuring" between tag fields

Hi there!

I want to change from

Artist: Adel Tawil
Title: Tu m'appelles (feat. Peachy)

to

Artist: Adel Tawil (feat. Peachy)
Title: Tu m'appelles

Of course, not only exact expression "(feat. Peachy)" should be moved, but everything beginning with "(feat", so that I can use it for the whole database at once.

I already tried several suggestions from the community, but I just can`t do it right.

For instance, I tried it with following two steps:

1) copy everything beginning with "(feat" from title to artist:

  • action: format tag field
  • tag field: artist
  • format string: %artist% $mid(%title%,$strchr(%title%,'(feat'),$len(%title%))

-> result for artist is: "Adel Tawil (feat. Peachy)" DONE! :slight_smile:

2) delete everything beginning with "(feat" from title:

  • action: format tag field
  • tag field: title
  • format string: $trim($left(%_title%,$sub($strstr(%_title%,'(feat'),1)))

-> result for title is: Deletion of the whole title! :frowning:

So obviously I am doing something wrong… which is no wonder as I have absolutely no idea what I am doing... :wink:

And actually, I do not want to copy and delete not only everything beginning with "(feat", but also everything beginning with "(ft." - how cant i put this together into only one string?

I would reallly appreciate it if somebody please could help me?

There are so many threads about this topic ...
see e.g. this one

Thanks but sorry, I can`t find the solution there neither.

I found a post with the same basic question in German:


"Ich möchte gerne eine Aktion haben die alles ab einer bestimmten Zeichenkette entfernt."

... But - as far as I understand - the offered solution is not solving the problem.

then see here:

Please: use the search word "feat" and go through the various suggestions.

1 Like

Thank you.

And yes, I thought I got it with this link, buter after doing some testing an then finally renaming everything I saw following bug:

original:

Artist: Söhne Mannheims
Title: Gesucht und gefunden

changed to:

Artist: Söhne Mannheims funden
Title: Gesucht und gefunden

Obviously there should not have been any action, as there was no "feat." or so in the title.

PLEASE: COULD YOU TELL ME WHERE IS THE BUG IN FOLLOWING ACTION?

ACTION: FORMAT TEXT FIELD
FIELD: "ARTIST"
STRING: "%artist% $mid(%title%,$strchr(%title%,'feat.'),$len(%title%))"

I know that it happend as of the "und" in the title, but I don`t understand what part of the string is causing it. :thinking:

the problem is the function $strchr() which should really be $strstr().
$strchr() returns the position of a single character (in this case "f") ... which leads to "funden".

1 Like

Great, that works now. :blush: :+1:

One last thing:

The final deletion action:

FIELD: "TITLE"
REGULAR EXPRESSION: "^(.+)( feat.+)"
REPLACE WITH: "$1"

deletes also everything beginning with "feather", for instance. How can that be avoided?

if you have always "feat." then use
feat\..*
Otherwise you would need the unification expression from the "swiss army knife" link.

1 Like

Thank you very much! :clap:

So there is now the step-by-step solution, creating a new action with 4 parts:

ACTION - ACTION - NEW

NAME: "Switch of Co-Artists from TITLE to ARTIST"

OK

1. REPLACE WITH REGULAR EXPRESSION
FIELD: "TITLE"
REGULAR EXPRESSION: "(ft. | ft. | ft | f. | (featuring | featuring | (feat. | (feat | feat. | feat | ft.| vs. | vs | vs.| versus "
REPLACE WITH: " feat. "

OK - NEW

2. FORMAT TEXT FIELD:
FIELD: "ARTIST"
STRING: %artist% $mid(%title%,$strstr(%title%,' feat.'),$len(%title%))

OK - NEW

3. REPLACE WITH REGULAR EXPRESSION
FIELD: "TITLE"
REGULAR EXPRESSION: "^(.+)( feat..*)"
REPLACE WITH: "$1"

OK - NEW

4. REPLACE
FIELD: "ARTIST"
ORIGINAL: " " [2 empty spaces]
REPLACE WITH: " " [1 empty space]

OK - OK

Afterwards, you have to filter the title tag also individually for at least
" und " | " and " | " y " | " with " | " mit " | " con " | "," | "@"
as they often are followed by co-artists (but not always - that is why you cannot do it automatically)

… and if you want to have replaced all this "feature" and "versus" stuff with just an "&", you only add following three action parts between part 3 and part 4:

REPLACE WITH REGULAR EXPRESSION
FIELD: "ARTIST"
REGULAR EXPRESSION: "(ft. | ft. | ft | f. | (featuring | featuring | (feat. | (feat | feat. | feat | ft.| vs. | vs | vs.| versus "
REPLACE WITH: " & "

OK - NEW

REPLACE
FIELD: "ARTIST"
ORIGINAL: "("
REPLACE WITH: ""

OK - NEW

REPLACE
FIELD: "ARTIST"
ORIGINAL: ")"
REPLACE WITH: ""

OK

Even though you found a solution (so many ways lead to Rome), it may be more concise to use an action of the type "Guess value" and an auxiliary field to move the featured name around.
This thread describes such a way:

The guessing pattern would be:
%artist% (feat. %feat_artist%)
This would also save you to remove the leftover brackets and spaces.

Thank you so much for sharing your solution, @olum!

I did run into some issues implementing it, though. I think Actions 2 and 3 assume that there is nothing in the Title field to the right of the " feat." except for the featured artist string. Unfortunately, some of my tracks with featured artists have text like remix name (or whatever) afterwards. The current form of Actions 2 and 3 will move that text into the Artist field as well as deleting it from the Title field.

After some fiddling, I've found the following to work for removing variations on "feat." (the first if "feat." is surrounded by brackets, the second not):

REPLACE WITH REGULAR EXPRESSION
FIELD: "TITLE"
REGULAR EXPRESSION: "(.*) \(([Ff]t\. |[Ff]eat\. |[Ff]eatures |[Ff]eaturing )(.*?)\)(.*)"
REPLACE WITH: "$1$4"

REPLACE WITH REGULAR EXPRESSION
FIELD: "TITLE"
REGULAR EXPRESSION: "(.*) ([Ff]t\. |[Ff]eat\. |[Ff]eatures |[Ff]eaturing )(.*?)($|( \((.*)))"
REPLACE WITH: "$1$4"

I'm sure there's a more elegant way of constructing this.

If I understand the Guess Value suggestion correctly, it would be implemented like:

GUESS VALUES
SOURCE FORMAT: "%title%
GUESSING PATTERN: "%dummy%(feat. %featartist%)%dummy%"

FORMAT VALUE
FIELD: ARTIST
FORMAT STRING: %artist% & %featartist%

Is that right?

Is it possible to use regex just for searching, rather than search and replace?

FORMAT VALUE
FIELD: ARTIST
FORMAT STRING: %artist% & %featartist%

Note that this will incorrectly insert " & " into ARTIST even if there was no FEATARTIST found in the previous steps. To avoid this, instead use:

FORMAT VALUE
FIELD: ARTIST
FORMAT STRING: $if(%featartist%,%artist% & %featartist%,%artist%)

1 Like

If you modify the format string as follows:
Format string: %artist%[ & %featartist%]
it will do the same as the longish $if() check.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.