I have this perfectly working awesome code, which I was given here a couple of months ago, that I use to maintain order and clarity in my GENRE tag
Replace "GENRE": "##" -> |
Replace "GENRE": " " -> ""
Replace "GENRE": "|" -> "|0"
Guess values %GENRE%: |%GENRE%
Format value "GENRE_ORDER": '000|001|002|003|004|005|006|007|008|009|010|011|012|013|014|015|016|017|018|
019|020|021|022|023|024|025|026|027|028|029|030|031|032|033|034|035|036|037|038|
0
39|040|041|042|043|044|045|046|047|048|049|050|051|052|053|054|055|056|057|058|0
5
9|060|061|062|063|064|065|066|067|068|069|070|071|072|073|074|075|076|077|078|07
9
|07X|080|081|082|083|084|085|086|087|088|089|090|091|092|093|094|095|096|097|098
|
099|09Y|09N|09X'
Format value "GENRE": $regexp($regexp($regexp(%GENRE_ORDER%,$regexp(%GENRE_ORDER%,'(?>\b('%GENRE%')\b)',),),'\|+','|'),'\|$',)
Replace "GENRE": "|" -> " ##"
But in time, a new need arose for a code working something like in reverse
Right now a case like this
##50 ##01 ##99 ##99 ##01 ##01
is treated by it to look like that
##01 ##50 ##99
but I would need it to become like this
##01 ##99
So right now the code takes out all doubled [tripled etc.] values that start with the marker >>##<<, leaving just one instance of them; and also rearranges everything what is left in the order listed within it
And the alternative version should only leave all doubled [tripled etc.] values that start with a marker >>##<<, leaving just one instance of them, while at the same time cutting out all not repeated [single appearing] values; and also rearrange them in the given order
The purpose for this is: if I have a "Track 1" with some values and "Track 2" with some values, and then combine them into single file "Track 1 + Track 2" I have to manually look at values from both original files and copy / put only the common ones into the new one. And that takes a lot of time and it is very easy to miss something or even make a mistake while doing so, because one file can have even 20-25 values
An I can't just select and copy values from "Track 1" and put them to "Track 1 + Track 2" and then select and copy values from "Track 2" and also put them to "Track 1 + Track 2" and finally run the old code, because for example "Track 1" could have >>##01<< while "Track 2" could have not; which in turn would falsely leave me with >>##01<< in "Track 1 + Track 2", while in a mater of fact it should only be in "Track 1"