Since Version v3.31a, the action "Split tag field" (in German: "Tag-Feld aufteilen") does not seem to work any longer. With such a script:
Tag-Feld aufteilen "ARTIST":";,/&"
Tag-Feld aufteilen "COMPOSER":";,/&"
Tag-Feld aufteilen "LYRICIST":";,/&"
Tag-Feld aufteilen "PERFORMER":";,/&"
I could separate
COMPOSER John Lennon & Paul McCartney
PERFORMER John Lennon,Paul McCartney,George Harrison,Ringo Starr
into
COMPOSER John Lennon
COMPOSER Paul McCartney
PERFORMER John Lennon
PERFORMER Paul McCartney
PERFORMER George Harrison
PERFORMER Ringo Starr
which is more compatible with a database indexing.
Currently the action does not seem to do anything.
Works fine here:
Action Split field by separator:
space & space
results as expected in:
Please show us your source content - for example in your COMPOSER field.
Same for PERFORMER split by a comma:
results in:
BTW:
I ran my tests using MP3tag v3.31d, once with the Quick-Action and once with a new Action Group containing two Actions (one for COMPOSER and one for PERFORMER).
This script I have stored as “Action”:
Up to the last release it did work perfectly.
Unfortunately it has stopped working since v3.31a.
I could not find a version v3.31d. Where did you get it?
From here:
I'm not completely certain, but I don't believe that the 'Split field by separator / Tag-Feld aufteilen' separator has ever accepted multiple separator characters in the way that you used it.
The documentation says:
This action type splits the content of a tag field into multiple separate tag fields based on a given separator character.
Had just updated to v3.31d (beta), still the same as with v3.31a.
Then I did split each ";,/&" into ";" and "," and "/" and "&" as four separate entries.
This now does work, but it leaves leading blanks in the entries:
"John Lennon, Paul McCartney" now becomes
"John Lennon" and " Paul McCartney". Previously it was:
"John Lennon" and "Paul McCartney".
I could live with four entries each instead of one each before.
But to extend to 16 entries, with "&" and " &" and "& " and " & " for each, is extreme.
So, I think it’s still a bug.
Please try comma space as separator.
It is important to order your Actions correctly.
First split by comma space. Then split by comma only.
BTW:
Your PERFORMER example above has no space around the commas.
You will need to wait for a response from @florian regarding this issue.
Sorry, did update the last post while you were writing.
The string given in "Separator" is taken as the sequence of characters that separate one field from the other.
Your string ;,/& would mean that
would have to be
COMPOSER John Lennon;,/&Paul McCartney
to get the fields split.
If you want to cater for different characters that should split the field, then try an action of the type "Format value" for e.g. COMPOSER
Format string: $replace(%composer%,&,\\,;,\\,',',\\, \\,\\,\\ ,\\)
As also e.g. "& " could be used as separator without the space being considered a part of a list of characters, I doubt that a string was ever taken as a list of possible separators.
If you tidy up your strings and remove the spaces around the separators then you would not get leading or trailing spaces in the fields.
Actually, my $replace() suggestion should remove leading and/or trailing spaces.
My first idea with $trim does not work in this case.
A much more complicated combination of a regular expression and a replace function could solve the problem with leading and trailing spaces in multi-value fields:
$replace($regexp($meta_sep(PERFORMER,§),\s*§\s*,§),§,\\)
Explanation:
1 . All existing PERFORMER multi-value fields will be combined into one new string, separated by a § character with $meta_sep, including the unwanted spaces.
2 . The regular expression $regexp would eliminate leading and trailing spaces around the § character in the string, but not between first name and last name
3 . The $replace command would change the separator character § into \\ which results in the original multi-value fields again.
This only works if there is no § character anywhere in the PERFORMER names.
Therefore I suggest to use @ohrenkino's $replace with a Format value Action.
This of course is a possible solution. But to be honest, some years later when looking at it I would not understand what’s going on there. I think this is the reason why the action "Split field by separator" has been introduced, to make action scripts self-explanatory.
As for leading and trailing spaces in fields, it is likely to be an issue if they occur at all. So, a scripting macro imho should not produce these.
I must confess, I was happy with the previous solution: each character given was treated as a separator, and leading and trailing spaces were removed.
I doubt that that what you described (supplying a list of characters) ever worked.
I think that nothing has changed with this function.
An example: I just constructed a composer
Mike Knapp vs. Pino Grzybowsky v Pino s Mike
and used the function "Split by separator" with
Separator: vs.
if the separator would be treated as a list, then the composer should change to
Mike Knapp\\Pino Grzybowsky\\Pino\\Mike
as there is a "vs." and a "v" and and "s".
But actually, the Composer changes to
Mike Knapp\\Pino Grzybowsky v Pino s Mike
as only the "vs." matches the separator string.
I've downgraded to version v3.30.
Now the old behavior is restored, and a separator list like "COMPOSER":";,/&" works perfectly.
I assume this was introduced with #68782.
Interestingly, Mp3tag v3.30 creates from @ohrenkino's example string
Mike Knapp vs. Pino Grzybowsky v Pino s Mike
with vs. as separator
Mike Knapp\\Pino Grzybow\\ky\\Pino\\Mike
I don't think this is the desired behaviour, nor what I had expected... ![]()
Update
There are some special cases that are worth noting:
v3.30: "Earth, Wind & Fire" or "Emerson, Lake & Palmer" becomes 3 single ARTIST with a separator ;,/&
v3.31d: Doesn't change the ARTIST
Please be careful not to use ;,/& in v3.30 for other group names, such as "Kool & the Gang", "Ike & Tina Turner", "Mumford & Sons" or "Klaus & Klaus".
To be honest, isn't that a really crazy example?
The optimal solution would be a list of valid separator strings, as well as removing all leading and trailing spaces from the destination tags.
You see me stumped.
I always thought that the function only worked with a string constant.
For me now the "Split by separator" action would be almost useless as the interpretation of the entered string as list would make it impossible to split e.g. by "vs" for the following selection of artists that have a VS, and/or a V and/or an S in the name
| Artist | Split Artist |
|---|---|
0 Musicians |
0 Mu\\ician\\ |
0-visionen |
0-\\i\\ionen |
2 Brothers on the 4th Floor |
2 Brother\\on the 4th Floor |
2 Eivissa |
2 Ei\\i\\\\a |
2 Live Crew |
2 Li\\e Crew |
2 Men 4 Soul |
2 Men 4 Soul |
2 Phat Ladies |
2 Phat Ladie\\ |
2 Pure Dust |
2 Pure Du\\t |
2 Uninterested (Tekno Mafia) |
2 Unintere\\ted (Tekno Mafia) |
2 Vibez |
2\\ibez |
2-4 Grooves |
2-4 Groo\\e\\ |
2Inventions |
2In\\ention\\ |
2Pac (Makaveli) |
2Pac (Maka\\eli) |
3 Besoffskis |
3 Be\\off\\ki\\ |
3 Colours Red |
3 Colour\\Red |
3 Doors Down |
3 Door\\Down |
3 Man Island |
3 Man I\\land |
3 Melancholy Gypsies |
3 Melancholy Gyp\\ie\\ |
3 Phase |
3 Pha\\e |
3 Speed |
3\\peed |
3apes Band |
3ape\\Band |
3rd Wish |
3rd Wi\\h |
3rdclassaliens |
3rdcla\\\\alien\\ |
3SL |
3SL |
4 Apostel |
4 Apo\\tel |
4 Clubbers |
4 Clubber\\ |
4 Non Blondes |
4 Non Blonde\\ |
4 Strings |
4 String\\ |
4 the Cause |
4 the Cau\\e |
BAUSA vs. Apache 207 |
BAUSA\\. Apache 207 |
Bushy vs. Sonic Boo |
Bu\\hy\\. Sonic Boo |
Camo & Krooked Vs Body & Soul |
Camo & Krooked V\\Body & Soul |
Emma Braslavsky |
Emma Bra\\la\\ky |
Friction vs Camo & Krooked |
Friction\\Camo & Krooked |
Futurebound Vs Metrik |
Futurebound V\\Metrik |
Kirk Degiorgio Vs Esoterik |
Kirk Degiorgio V\\E\\oterik |
Lisa Miskovsky |
Li\\a Mi\\ko\\ky |
Lucy Diakovska |
Lucy Diako\\ka |
Magvay & Novskyy |
Mag\\ay & No\\kyy |
Marjana Lipovsek |
Marjana Lipo\\ek |
Noam Brusilovsky |
Noam Bru\\ilo\\ky |
Noam Brusilovsky; Lucia Lucas |
Noam Bru\\ilo\\ky; Lucia Luca\\ |
Peter Tchaikovsky |
Peter Tchaiko\\ky |
Rumena Bužarovska |
Rumena Bužaro\\ka |
Simone Kucher; Petros Ovsepyan |
Simone Kucher; Petro\\O\\epyan |
Tamara Jagellovsk |
Tamara Jagello\\k |
Tord Gustavsen Quartet |
Tord Gu\\ta\\en Quartet |
VS Mafia |
\\Mafia |
I would consider this behaviour to be a bug.
I think we have to wait for a word by the developer.
The same applies to 'feat.' and any other separator using an entire word.
Perhaps @florian could shed some light on this issue?
My proposal for defining "separator" is as a series of character strings separated by \\.
Example:
Old ";,/&"
New ";\\,\\/\\&"
Then "vs." will meet your requirements and it will avoid multiple action definitions for a single field.
Yes, I've re-implemented the action when fixing the linked issue. The way I've implemented the action is the intended behaviour, so that words or abbreviations like feat. can be used without problems.
What I've missed in my re-implementation is trimming spaces. Thanks for pointing this out! I'll fix this with the next release, so that only one action per separator character or string is necessary.







