Semicolon separator

I discovered that I have a problem with the semicolon separator. It appears that Jriver uses the semicolon without the space after (“something A”;“something B”) while Picard, and other programs, consider the semicolon as a separator only if followed by the space (“something A”; “something B”).
Since I do some modifications and tag editing operations on Jriver, this creates several problems on multi-valued tags, not allowing picard to interpret them as multi-valued. Do you have any suggestions?

Which file and tag format are you using?

The only format where Picard would separate multiple values with a text separator would be ID3 v2.3. The default there is /, but you can change it to any other value in Options > Tags > ID3. The dropdown there also offers the choice of ; (with a space behind the semicolon), but you can also enter any other value and could set it to ;.

They are all flac, so vorbis comment.

Picard doesn’t use separator strings for Vorbis comments. Instead it properly stores multiple values as multiple tags.

If Jriver stores multiple values just separated by a semicolon instead and you want to have this as proper multiple values in Picard you will need to split it up.

This could be done with the help of a script. E.g. for the artist tag the below tag would set a value like “Artist A;Artist B” as two separate values “Artist A”, “Artist B”.


ok, this only works the first time and correctly splits the single string into multiple parts.

The problem is that every time I reprocess (except the first one) leading spaces are added to all the values except the first one and I can’t remove them even using the trim or strip functions.

What exactly do you mean by “reprocess”? When you edit those through driver again?

If jriver insists of having multiple values separated by semicolon only maybe it is best to keep the tags like this instead of trying to force multiple separate tags on it?

Is there some specific use case why you need the multi values in Picard after loading the files from jriver?

The main issue is on a custom tag that collects any fields not to be modified and updated with this script


and Picard if it doesn’t have the semicolon with the space, considers it a single string and the script doesn’t work.

If I run your script it correctly splits multiple values into multiple tags and the $foreach script works fine.

The problem occurs later if I run a query again to check for new metadata updates.
In this case the script is re-executed but, if in the meantime I haven’t made any changes in jriver which has saved the value again as a single string with the semicolon, Picard finds itself with multiple tags and creates these additional spaces which compromise the effectiveness of the $foreach script.
These extra spaces I can easily remove them from the edit tag window, but I can’t do it via script with functions like $strip, $copymerge… and I don’t understand why

The $foreach function accepts an optional third paramater to specify the separator.
So if I have correctly understood your issue, the following should work:


Ok, it seems to work fine. Thank you!! :slightly_smiling_face:

I’m not an expert in programming languages but I try to learn, so sometimes I might ask or not understand obvious things.

I still don’t understand why I can’t eliminate whitespace even with functions. It might be useful for other scripts