Split a tag to multiple tags

I'm trying to split a Tag Value to Multiple Tags.
For Example, here's a COMMENT tag along with it's corresponding value.

COMMENT: Categories – Trumpet\\Genius

What i need want to achieve is:


here's a similar problem. but i just can't figure it out.
Hopefully someone can enlighten me.

First create an action of the type "merge duplicate fields" for comment and use as separator the underscore _.
After this you have the contents of the comment fields in one comment field.
Now create an action of the type "Format tag-field" for CATEGORIES with the
format string: %comment%
This copies the content of COMMENT to CATEGORIES.
Then create an action of the type "Split field by Separator" for CATEGORIES with the separator underscore _.
You should now have multiple instances of CATEGORIES in the files.
Do whatever you like with the contents of COMMENT.

You have pointed to an outside forum's message, which depends on a forum thread from here ...

If you see this text ... "Categories – Trumpet\\Genius" ...
in Mp3tag within a listview field or tag panel field, ..
then you have to do with a so called "multi-value" tag-field, ...
because Mp3tag uses the "\\ double backslash" as the visual delimiter for multi values stored within one tag-field ...
Value 1: Categories – Trumpet
Value 2: Genius

Because you want to create a new multi-value tag-field CATEGORIES ...
out of textual parts from the tag-field COMMENT, ...
to be extracted from each single value out of the multi-value tag-field COMMENT, ...
then you have to do it in few steps.

  1. Copy COMMENT (meta values) to CATEGORIES (merged values).
    Action "Format value"
    Formatstring: $meta_sep(COMMENT,'~')
    Result ...
    CATEGORIES = 'Categories – Trumpet~Genius'

  2. Remove the unwanted text, for example by splitting the given text into parts.
    Action "Guess values"
    Source format: %CATEGORIES%
    Guessing pattern: %DUMMY% – %CATEGORIES%
    Result ...
    CATEGORIES = 'Trumpet~Genius'

  3. Make CATEGORIES multi-value.
    Action "Split field by separator"
    Separator: ~
    Result ...
    CATEGORIES = 'Trumpet'
    CATEGORIES = 'Genius'

  4. Ready.

All steps consolidated into one step ...

Action "Format value" Field: CATEGORIES Formatstring: $replace($meta_sep(COMMENT,'~'),'Categories – ',,'~','\\\\')


Thx for the reply guys.


In a previous version of MP3Tag, whenever i would perform a REGEX on multiple files, the values with "\\" in them would automatically be split over multiple tags. Which, i guess, is the intended behaviour.

In the current version of MP3Tag v2.69 however, the '\\' doesn't seem to split the values over multiple tags. To force "\\" conversion to multiple values, i have to CTRL+S the files individually.
So after REGEX i'm left with what is seen on Extended Tags screenshot.
As you can see its not a visual representation but rather literal one.

Now, if i apply the tags above with your action, the results has some undesired effects:
Action "Format value"
Formatstring: $replace($meta_sep(COMMENT,'~'),'Categories – ',,'~','\\')

White = need attention, it gets CATEGORIES as fieldname
Purple = split values
Grey = original tags

Obviously the desired format would be:


Maybe an even better approach? This way B would always the end up with the correct fieldname.

1. Is there a way to target fieldname A 2. Split B and C from the values 3. and then assign B as new fieldname, with C as value

Sorry for being a pain. Still learning here.

Yes, so far it was, even in Mp3tag v2.69 as I can tell.

Obviously you are a friend of special characters.
Well I have already detected, that you have used in your examples the en-dash '–' instead of the standard hyphen '-'.
But that you are so angry, and cheat us with the backslash too, I had not expected.

Your 'backslash' seems to be some other character from the Unicode character set, which looks like a backslash, ... for example ...
'\ Set minus (U+2216)'
'╲ Box drawings light diagonal upper left to lower right (U+2572)'.
See also ...

Before going deeper into your problem, you have to comprehensible describe and clarify how to create the situation as shown by your picture with the muti-value COMMENT tag-field.

On my side, when using the standard double backslash '\\', then Mp3tag works as expected and creates a multi-value tag-field in the moment when writing the tag to the file.


To make long story short ... I made example actions for you ...

From ...
COMMENT = Artist Location - American
COMMENT = Track Decade - 2010s
COMMENT = Categories - Genius~Trumpet

To ...

Begin Action Group Test2015#20150322.PeaterParker.Step1

Action #1
Actiontype 5: Format value
Field ______: COMMENT
Formatstring: Artist Location - American\\Track Decade - 2010s\\Categories - Genius~Trumpet

End Action Group Test2015#20150322.PeaterParker.Step1 (1 Action)

Begin Action Group Test2015#20150322.PeaterParker.Step2

Action #1
Actiontype 5: Format value
Field ______: TEMP_COMMENT
Formatstring: $meta_sep(COMMENT,';')

Action #2
Actiontype 5: Format value
Formatstring: $replace($regexp($regexp(%TEMP_COMMENT%,'Artist Location - ([^;]+)','$1\\'),'(Track Decade|Categories) - ([^;]+)',),';','\\')

Action #3
Actiontype 5: Format value
Field ______: TRACK_DECADE
Formatstring: $replace($regexp($regexp(%TEMP_COMMENT%,'Track Decade - ([^;]+)','$1\\'),'(Artist Location|Categories) - ([^;]+)',),';','\\')

Action #4
Actiontype 5: Format value
Field ______: CATEGORIES
Formatstring: $replace($regexp($regexp(%TEMP_COMMENT%,'Categories - ([^;]+)','$1\\'),'(Track Decade|Artist Location) - ([^;]+)',),';','\\')

Action #5
Actiontype 16: Split fields by separator
Separator: ~

Action #6
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TEMP_COMMENT;COMMENT

End Action Group Test2015#20150322.PeaterParker.Step2 (6 Actions)

Test2015_20150322.PeaterParker.Step1.mta (112 Bytes)Test2015_20150322.PeaterParker.Step2.mta (627 Bytes)

Test2015_20150322.PeaterParker.Step1.mta (112 Bytes)

Test2015_20150322.PeaterParker.Step2.mta (627 Bytes)