How do I setup an Action to 'replace with regular expression' for
replace Bonobo\\Andrew Ashong with Andrew Ashong in Artist??
!!! the '\\' characters are defeating me !!!
I have tried 'Bonobo\\' > ' ' to get rid of them but no luck. The '' is a special character and using '' in front should change it to a literal. Hence I need four '' like this '\\'. It doesn't work so I must have not understood correctly.
I think you have a so-called multi-value field there as MP3tag separates two fields with the same name with the double-backslash.
If you have a look at the fields in the extended tags dialogue (Alt-T) the you will see 2 fields with the name ARTIST, one filled with Bonobo, the other with Andrew Ashong
you can now delete one of the multivalue-fields (the one with Bonobo in it)
Or you merge the multi-value field and set the separator to a character that MP3tag does not treat like a field separator, e.g. the _
for a description of the action.
Then you can use a replace action to get rid of the unwanted bits.
I am getting some inconsistent behaviour. I found that sometimes the \\ is recognised as separator in extended tags and sometimes not.
eg for artist1//artist2 in the Artist main column sometimes shows in the extended fields as two separate artists, artist1, artist2, and sometimes as just one artist like this 'artist1//artist2'!!
I can generate this inconsistent behaviour by setting the separator character in the merge action to also be \\.. At first nothing appears to change in the Artist column but the extended tag now shows only the one artist as 'artist1//artist2'. Undo reverses the change and artist1//artist2 shows correctly in extended tags as two separate artists!!!
Life is never simple is it!
So first I need to get the \\ recognised as a separator character consistently. ??How??
You do not need an action 'replace with regular expression' for simple replacing a complete tagfield's value by another value.
An action "Format value" will work.
If you see in the Mp3tag user interface a string value like "Bonobo\\Andrew Ashong", then this is likely the linear representation of a so called 'multi-value' tag-field.
Mp3tag uses the double backslash as the visual delimiter between two separate values.
You can check this situation inside the Dialog "Extended Tags...".
There you should see two independent tag-fields of the name ARTIST, each filled with a different value of "Bonobo" and "Andrew Ashong".
Note: A string value like "Bonobo//Andrew Ashong" is just one item.
If you want to replace the entire content of a multi-value tag-field with one item from the listed items, then you have to pick this one item and format the tag-field with this item.
For example, the second item should be selected ...
Action = Format value
Field = ARTIST
Formatstring = $meta(ARTIST,1)
Note: Function $meta counts from zero.
OK... I now find if I save a track that shows in extended tags as just one artist as 'artist1//artist2' then after the save it shows as two artists artist1 and another as artist2. Selecting all tracks and saving does not change the behaviour.
I cannot identify on the main screen any differences in the artist column between the two behaviours.
How do I find and replace a string in artist 'artist1//artist2' so that it behaves correctly?
It tried that on a troublesome artist 'Afterlife\\Kid Stone' and the result was blank for the Artist.
I also tried it on a non-troublesome Artist also 'Afterlife\\Kid Stone' and the result was 'Kid Stone'.
edited to add:
I think I found a way to locate the troublesome artists. If I add \\ in the filter then only the misbehaving fields show. The only fix I have found so far is to individually select a track and save it. Selecting multiple tracks and saving does not fix it
Thanks guys... I feel like we are getting somewhere but I still not identify and fix the troublesome artists.
How do I check???... the good and bad both look like \\.
I have now found a way to fix the behaviour. If I use for the filter \ or \\ and Select All and apply split with \\ as separator MP3tag reports nothing changed but I now find that \\ separator works as it should. If I refresh the tracks disappear.
I have found the problem is not only in artists but also in composers too.
I also found that MP3tag itself is causing the problem. eg if I use Replace action to change any character in any field to \\ then these fields misbehave and do not show as two separate items but show as one.
editted to add......
I must have at some point used the Replace action and not the Split Field action to create the \\ as the field separator.
Now I have lot of files to change and backup!!! It will take a few days...
Maybe a warning in the help would avoid others making the same mistake or change the Replace action so it can create functioning \\ field separators....
Thanks for helping
ps I created some actions but found even they crash if there is a / in the title.
To convert a tag-field value, which contains a double backslash, into a multi-value tag-field, it needs an additional step of saving the tag again.
Further on you can make following tests.
Format a tag-field "A" with '<!--colorc-->'. This will result into a tag-field "A" with value content "".
Format a tag-field "B" with '\\'. This will result into removing the tag-field "B".
Format a tag-field "C" with '\<!--colorc-->'. This will result into a tag-field "C" with value content "".
Format a tag-field "D" with '\\'. This will result into removing the tag-field "D".
... and so on.
This behaviour is understandable and follows the rule for "\\" as the multi-value delimiter sequence.
Do another test.
Format a tag-field "A" with value 'a a#bb#c c c'.
Apply the action "Split field by separator" against the field "A" and set the separator to "#".
The result is a multi-value tag-field with three elements ...
A with value content "a a"
A with value content "bb"
A with value content "c c c"
... which is ok.
When using the Formatstring $meta_sep(A,'\\') it will give the result "a a\\bb\\c c c".
Do another test.
Format a tag-field "A" with value 'a a#bb#c c c'.
Apply the action "Replace" against the field "A" and replace all occurences of "#" with "\\".
The result is a single-value tag-field with one item of value content "a a\\bb\\c c c".
After opening the dialog "Extended Tags..." and then closing the dialog with "OK" this tag-field will be converted into a multi-value tag-field.
This conversion effect can also be created with an action "Format value" on the tag-field "A" ...
using the format string: $meta_sep(A,'\\')'\\'
I solved my problem using the split field action.
Thank you for your comprehensive explanation.
I am only a casual user so its going to take me a while to understand that but I think its the same as I said about Split Field vs. Replace actions. One produces a \\ as separator and the other a string field with \\ in the field ... all by design but confusing at first to the casual user.