Using single value from multivalue field

I'm trying to create an action that takes the 1st value from ARTIST and populates the ALBUMARTIST field.

Right now I have:

Format Value
Format String: $meta(artist,0)

Using this, I'm still getting every value from ARTIST. I also noticed that $meta() isn't in the list of functions in the Actions dialog.

Any ideas?

First we have to clear the facts.
As you said there might be a "multi-value" tag-field ARTIST.
Please apply this format string in the converter "Tag - Tag" ...


Please let us see the resulting string from the preview window.

Second check.
Open the Filter dialog and apply this filter string to the file list ...

NOT "$meta(ARTIST,1)" IS ""

Do you see files with "multi-value" ARTIST in the list view?


Actually I didn't say their might be. I know they are multi-value since I added them myself in F2K which shows the values correctly. In fact, using the $meta function in F2K works as expected.

C:\Users\Cristov\Music\CDs\My Collection\Christina Aguilera\Bionic\[03] Woohoo.mp3
  "Woohoo" ->
  "Christina Aguilera / Nicki Minaj"

The 2nd test shows no results.

foobar2000 displays a real "multi-value" tag field this way ...
"Christina Aguilera; Nicki Minaj"

Mp3tag displays a real "multi-value" tag field this way ...
"Christina Aguilera\\Nicki Minaj"

This content is not a real "multi-value" tag field ...
"Christina Aguilera / Nicki Minaj"
This is a single text item having two text components separated by the string " / ".

This indicates, there is no tag-field ARTIST of type "multi-value".

You can use the Mp3tag action "Split field by separator" to convert the single value into multi-value ...
Separator: /
Write only one slash character.
If more different characters are used, then each character determines a split point.
Leading and trailing space characters will be automatically removed from the new items.

You can use the Mp3tag action "Merge duplicate fields" to convert "multi-value" into "single-value" ...
Separator: /
The separator string can have more than one character.

Check the list of tag-fields in the dialog "Extended Tags...".

If you do not want to change the existing single-value tag-field ARTIST into multi-value, then you may apply the following format string ...
Action: Format value
Format string:

$regexp(%ARTIST%,'^(.+?)\s+/\s+(.+?)$','$1') ... gives first part before " / "

... or ...

$regexp(%ARTIST%,'^(.+?)\s+/\s+(.+?)$','$2') ... gives second part behind " / "

... or ...

$left(%ARTIST%,$sub($strstr(%ARTIST%,' / '),1)) ... gives first part before " / "

... or ...

$cutLeft(%ARTIST%,$add($strstr(%ARTIST%,' / '),2)) ... gives second part behind " / "


So Foobar doesn't write multi-values correctly using a semicolon? Is there some setting I need to change in F2K to make it work properly? Even after I used the split value option in the F2K properties dialog Mp3Tag does not show them as multiple values.

If you use ID3v2.3 tags then foobar and Mp3tag use different ways for multi value tags.

With foobar "properties/context Split values..." it is possible to split the string ...
"Christina Aguilera / Nicki Minaj"
into a multi-value field by split character "/", so foobar displays the field content as ...
"Christina Aguilera; Nicki Minaj".

As Dano has remarked, there is also a difference between the tag-types ID3v2.3 and ID3v2.4.
You should consider this too.

Using tag-type ID3v2.4 there is interoperability between foobar and Mp3tag on "multi-value" tag-fields.


Ok. I'm using 2.3 so I need to do some research I guess and find out if and how I should convert my existing tags to 2.4. If you have suggestions on that, please advise. Thanks.

Better think twice as V2.4 tags are not supported by many applications, e.g. Windows Explorer or BPMAnalyzer.
To convert: set File>Options>Mpeg write to V2.4.
Close the dialogue.
Select all the files, copy the tags and then paste them.
If this does not work: cut the tags and then paste them.

Good to know. I've been meaning to grab BPM Analyzer. I've been using a F2K component but I like that app better.

If anyone knows a way I could search for multivalue fields in F2K I would be grateful. I can't use the $meta_num function from what I can tell.

If you want to change the tag-type from ID3v2.3 to ID3v2.4 you can do this from within foobar or from within Mp3tag.
In Mp3tag set the options for Mpeg Write to ID3v2.4 UTF-8, then select the loaded files and save them using [Ctrl+S].

On the other hand you can stay with tag-type ID3v2.3 UTF-16.
Above in post #4 there is a scripting solution without $meta functionality to solve the origin problem of splitting a given string into components.