Splitting multiple entries in a Tag value

Some of my FLAC tags have multiple entries in a single Tag field e.g. the Genre entry may contain "Rock, Classic Rock, Hard Rock". Entries are always separated by a comma or other delimiter ';'.

Whilst I would like to maintain each of the entries within the Gentre tag, it seems a preferred approach is to create multiple Genre tags, each with a discrete entry, whereby the abovementioned example would result in three Genre tags for the track in question, the first being "Rock", the second being "Classic Rock" and the third being "Hard Rock".

So my question is, is there a way to traverse a series of tracks and parse the existing Genre tags, searching for a "," or a ";" and if found, to parse the string and create an additional Genre tag for each entry, and then finally changing the first Genre tag to remove the additional entries?


GENRE: Rock,Jazz;Beat,


By steps:

Run actionsgroup:

Begin Actionsgroup TEST_egd

Action #1
Actiontype 5: Format tag field
Field: GENRE
Formatstring: $regexp(%genre%,','|;,\\)
Formatstring: $regexp(%genre%,',|;','\\')
Formatstring: $regexp(%genre%,'\s*[,;]\s*','\\') (respects spaces around delimiters)

End Actionsgroup TEST_egd (1 Action)

Afterwards press [Ctrl+S] or use menu dialog to save tag.


Thanks for the abovementioned regex, which writes out GENRE=gentre1\\genre2 etc.

Is this how mp3tag always deals with multiple entries in a tag, as I understand that the "standard" dictates that the preferred method is to create multiple Vorbis tags rather than use a delimiter?

Would it be possible to write the multiple entries rather than create a \\ delimited string, which is in effect much the same as my approach of using a ';' or a ',' ?

If you respect point "2. Afterwards press [Ctrl+S] or use menu dialog to save tag.", then Mp3tag will create a single tag field for each genre item in mp3 file.
I do not know if this procedure works with other music file types too e. g. wma.


Works like a charm, thank you :slight_smile:

One thing to note - the point 2 part only works so long as the TAG entries for the selected tracks whose specific tags you're wanting to work on are identical, so the best thing to do is sort by tag value and then apply point 2.


I tried the split action (split fields by seperator) on some of my mp3s (they were all tagged the same way for the genres: Hip-Hop, Reggae, Russian)

After the action, I pressed Ctrl+S and my mp3s were successfully tagged Hip-Hop\\Reggae\\Russian.

Unfortunately, it seems that mp3tag only takes the first tag, i.e. Hip-Hop, and ignores "Reggae" and "Russian"

What am I doing wrong? :unsure:


You can use something like $meta(genre) or $meta_sep(genre,-) to retrieve all instances of a given field.

Kind regards,

Hum... you lost me... :flushed:

What can I do to turn



Now, mp3tag takes only genre=Hip-Hop so the other genres are ignored by it, and therefore my mp3 player (samsung P2).

thanks in advance

The tag editor feature seems buggy when working with artist fields that have multiple values. When I try to set multiple artists on wma lossless files, either by using the "\\" trick or by adding an ARTIST field multiple times in extended tag editor, I get duplicate values and other problems. (For instance: Brahms\\CSO\\Perlman\\CSO\\Brahms). I've tried various ways to correct it, but none of the corrections "take." Possibly it was not designed to edit tags that have multiple values.
--I can edit these values successfully using the wmp 11 built-in tag editor, but perhaps this is not well documented for wma files.