Move a featured artist from the ARTIST to TITLE tags

I had a whole bunch of music where only some of the ARTIST tags contained a featured artist(s) and I wanted to move that to the TITLE tag and then remove the featured artist information from the ARTIST tag

I tried various potential solutions from this forum, but none of them worked

This is what I came up with though, and thought I'd share (as I can't be the only one to struggle with this)

Example ARTIST tag: "Madvillain feat. Viktor Vaughn"
Example TITLE tag: "Fancy Clown"

End result ARTIST tag: "Madvillain"
End result TITLE tag: "Fancy Clown feat. Viktor Vaughn"

If the ARTIST does not contain " feat." then leave the tags alone

I created myself a new Action Group with two steps

  1. move the " feat. <artist(s)>" from the ARTIST tag to the end of the TITLE tag
  2. remove " feat. <artist(s)>" from the ARTIST tag

Step 1 is a Format Tag Field action
Field = TITLE
Format = $ifgreater($strstr(%artist%,' feat.'),0,%title% feat. $mid(%artist%,$add($strstr(%artist%,'feat. '),6),$len(%artist%)),%title%)

Step 2 is a Format tag Field action
Field = ARTIST
Format = $ifgreater($strstr(%artist%,' feat.'),0,$left(%artist%,$add($strstr(%artist%,' feat.'),-1)),%artist%)

Note: the $strstr() function returns a number (0 if the search string isn't found) so I couldn't use $if() I needed to use the math $ifgreater() function

$ifgreater(a,b,x,y) if number a is greater than number b, x is returned, otherwise y.

If the $strstr() returned zero (it didn't find a " feat.") then I just retained the original field

I also had to use $add() around the $left() function in Step 2 to remove the trailing space after the artist name and before the "feat." string (this was done by "adding" -1 to the length of the string we return)

Hope this helps...

Please feel free to simplify (e.g. there may be a way to wrap the whole Action Group using the "if ARTIST doesn't contain 'feat.'" then exit/do nothing

I would apply a filter with
%artist% HAS feat.

and then use a single action of the type "Guess value" as described in this thread:

Hi, a couple of questions come to mind:

  1. how/where would you add the filter?

  2. I'm not sure how to create a new Guess Values action

  3. could you explain what that Guess Values Source Format and Guessing Pattern are actually doing please?

I'm on a Mac btw (if that makes any difference - I've noticed that some of the help/screenshots on Windows don't always align with the Mac UI)

Yes. This makes a difference. In this case, the WIndows action "Guess value" is called "Import tag fields".

The filter is an MP3tag function

and I would apply the filter before I execute the action to make sure that only files with a featured artist are treated.

The action of the type "Import tag fields" is sort of expansion of the function "Convert>Filename-Tag".
The Convert function always takes the data from the filename as source, the action "Import tag fields" takes any format string as source.
The target defines a pattern of field variables and text constants that assigns the string parts to the named fields.
So, the idea is to take the data from ARTIST and TITLE and rearrange them in such a way that they can be split with unique separators - here the +++ which then can be imported into the fields as defined in the target string.

Ah right

My goal was to come up with an Action that I could run against any/all files and it would only affect those tracks that had a "feat." in the ARTIST - rather than having to filter and then run the Action

I'm not sure the Format Tag on Mac provides for the same functionality as the Guess Values does on PC

Have you tried to copy and paste:
Source Format: %title% $regexp(%artist%,(.*) Feat. (.*),'('Feat. $2')' +++ $1)
Format string: %title% +++ %artist%

please note that the format string is case sensitive.

I tried it on this:

using this:

It didn't do anything

NB: I adjusted your suggested to allow for lower case "feat"

You used an action of the type "Format tag field" instead of "Import tag field"

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