Moving part of TITLE to GENRE

Unfortunately, it removes everything placed before the last "##"

That seems to do nothing

The sorting could be done quite easily [although in long steps]

A] Remove all the "##" [which leaves numbers in format >>00<<]
B] Replace words with numbers [in format >>00<<]
C] Leave only one instance of each number [because I need to remove the doubled and tripled ones]
D] Rearrange numbers in order [sort them out]
E] Put two pauses after each number
F] Change [specified] numbers back to words
G] Put back "##" in front of the numbers
H] Put back "##" in front of the words
I] Remove unnecessary pauses

So, I would like to ask for codes for point C, D and E

Also, I'm afraid that step D could mess things up [because it could possibly turn for example "99 01" into "0199" instead of "01 99"]

And please note, that all the time I'm using the "##" [double hashtag] as a marker and not "#" [single one]; becasue I already use a single # chacacter [in TITLE tag for different purposes]

Shame this, really. Sorry.
If it is always the ## that separates TITLE from GENRE, you could apply an action of the type
"Guess value (Import tag field)" for TITLE
Guessing pattern: %title% #%genre%

you loose the leading #.

I did some test and thinking about that whole guessing pattern and came with solution with workaround / fail-safes

But I still don't know how to simply sort numbers in order and put two pauses after each number [step D and E]

So, does any one now how to sort two digit numbers in an ascending matter?

For example:

BEFORE
01 10 22 21 33 99
AFTER
01 10 21 22 33 99

BEFORE
99 01 10 22 21 33
AFTER
01 10 21 22 33 99


BEFORE
10 99 01 22 33 21
AFTER
01 10 21 22 33 99

If you are looking for a built in function: hard luck, there is none.
Also, you cannot use any nested loops to treat a string.
You could export the field to a text file,
use the command shell function "sort"
let "sort" create an output file that you then import back into the tag.

To see what "sort" can do, open a command shell window and type in: help sort

AFAIU sort needs one sort item per line

Mp3tag has no sort function to be used within formatstring.

You may have a look there ...
Feature request: Import tags from clipboard
... maybe you can adapt it to your needs.

DD.20150616.2156.CEST

Unfortunately that's just to much effort / steps; beause I will need this to be done on 18000 files

And after a couple of weeks / months, I will repeat the whole operation, with even more files

That looks adaptable to my needs

But, aside from possible re-designing the system, it would still require physically going [switching] to another window with different program and doing there some clicking? If yes then I will have to do this sorting manually

As long as I will do it on a big set of files and have all the data in the same format [with numbers], I could to this quite efficient; aside from course occasionally missing some errors, which can be possibly taken care of during the next evaluation

And the bigger the set the better [to some point I imagine...], because it will be somewhat easy to spot an error like this

##01  ##02  ##03  ##44  ##59  ##99  ##90

if it is between tens of looking the same correct ones

##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##90  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##60  ##99
##01  ##02  ##03  ##44  ##59  ##99  ##90
##01  ##02  ##03  ##44  ##59  ##99  ##90
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99
##02  ##03  ##44  ##59  ##60  ##90  ##99

I just need enough correct cases, so that errors will "pop out" while scrolling the view down

[I've already tried to the the first evaluation and in mixed system, with words between bumbers, it looks like chaos; I just stopped after first few screens]

zerow, I do not understand what you are telling me, ...
therefore I made an example action group script ...
to demonstrate how to sort number strings in the range from '01' to '99'.

Begin Action Group Test2015#20150617.Example.Sort.01to99

Action #1
Actiontype 5: Format value
Field ______: LIST_CURRENT
Formatstring: '04|21|69|99|17|01|38|78'

Action #2
Actiontype 5: Format value
Field ______: LIST_ORDERED
Formatstring: '01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|
41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|
61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|
81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99'

Action #3
Actiontype 5: Format value
Field ______: LIST_RESULT
Formatstring: $regexp($regexp($regexp(%LIST_ORDERED%,$regexp(%LIST_ORDERED%,'(?>('%LIST_CURRENT%'))',),),'|+','|'),'|$',)

End Action Group Test2015#20150617.Example.Sort.01to99 (3 Actions)

... which gives ...
LIST_RESULT = 01|04|17|21|38|69|78|99

Test2015_20150617.Example.Sort.01to99.mta (535 Bytes)

DD.20150617.1836.CEST

Note: Regular expression has been changed ... see there ...
Moving part of TITLE to GENRE

DD.20150626.1116.CEST

Test2015_20150617.Example.Sort.01to99.mta (535 Bytes)

I have run this action group on a field with value

04|21|69|99|17|01|38|78

And it stayed the same; nothing changed

Aside from that, my question is: is this is going to work only, if I predefine [write down to that action group] a separate entry [action] for every possible combination of errors?
For example a common mistake will be

##01  ##01  ##02

But also there can be something like

##01  ##01  ##01  ##02
##01  ##99  ##01  ##02
##99  ##01  ##02
##99  ##01  ##99  ##02
##02  ##01  ##02

Putting all possible cases is just impossible for a human being

Please try again.
At my side there is no problem to get ...
LIST_OUT=01|04|17|21|38|69|78|99
from ...
LIST_IN=04|21|69|99|17|01|38|78
LIST_IN=04|21|69|99|17|17|01|38|78|21
LIST_IN=78|04|04|04|21|69|99|99|17|17|01|38|78|21|78

DD.20150622.0943.CEST

I've read the code and thought about what is suppose to happen and finally understood it [but not how it is happening]; and so I see that it works now

And now I have the right tool and the knowledge how to adapt it to my needs. I've already made some changes in it. But to make the whole operation simpler [with less steps, which will come in handy in the future in case of making any changes to the naming structure] I've tried to replace the

|sign used by you with the indicators used by me, in form of
##

And with such change, the code stops to work. Is there some problem with using hashtags? Or a change like that shouldn't be a problem and I just messed up something?

Also: why does the first number [in my unsorted string of numbers] can't have the indicator? I have putted it to the front of LIST_ORDERED, but it didn't help

Note: The pipe symbol or vertical bar "|" has the meaning of "alternation" resp. "or", ...
and is used within the regular expression to separate alternative values.
'01' or '02' or '03' ==> '01|02|03'
See also:
http://www.regular-expressions.info/alternation.html

I don't know for sure, but you may try for your case ...
'##01|##02|##03'
... or ...
'##(01|02|03)'

DD.20150624.2020.CEST

Those two suggestions didn't work, but I've managed in some other way

Here is my action group:

1] Guess values %GENRE%: ##%GENRE%

2] Replace "GENRE": "##" -> |

3] Replace "GENRE": "  " -> ""

4] Format value "GENRE_ORDER": '00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|2
5|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|TRIBAL
|
UNDERWATER|VILLAGE|WASTELAND|WATER|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|
7
5|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|9X'

5] Format value "GENRE": $regexp($regexp($regexp(%GENRE_ORDER%,$regexp(%GENRE_ORDER%,'(?>('%GENRE%'))',),),'\|+','|'),'\|$',)

6] Replace "GENRE": "|" -> "  ##"

7] Format value "GENRE": $trim(%GENRE%)

8] Format value "GENRE": ##%GENRE%

It works if run it on a GENRE tag that has values in format

##00  ##00  ##AAAAAAA  ##00  ##BBB

[two hastags + two digit number or predifined capitalized word + two pauses]

But:

A] What is the code for making any number of spaces into only two spaces, including in the middle of a tag? Or what is the code for making 3 or more spaces into two spaces? Right now I use [before I run this action group that we are speaking of in this post] many many [just for sure] instances of

Replace "GENRE": "   " -> "  "

for achieving my format

B] This code has a big issue. If you run it on

##9X  ##WATER  ##00  ##UNDERWATER  ##50  ##VILLAGE

it will give you a proper

##00  ##UNDERWATER  ##VILLAGE  ##WATER  ##50  ##9X

But if you run it on

##9X  ##WATER  ##00  ##50  ##VILLAGE

you will get a reasult with a wrongly doubled value

##00  ##WATER  ##VILLAGE  ##WATER  ##50  ##9X

just because on the list of words [within this list of those 00-99 numbers] there is "UNDERWATER" and "WATER". I could work around this problem by temporary changing words to some additional numbers / codes [like X00, X01, X03], but as the word list is a work in progress, I would rather not have to [remember to make additional changes in this GENRE rearranging action group every time I will add new words or change the old ones]

TEST_SPACES <== 'xx xx xx xx xx xx xx xx xx xx' TEST_RESULT <== $regexp(%TEST_SPACES%,' +',' ') TEST_RESULT = 'xx xx xx xx xx xx xx xx xx xx'

DD.20150625.0709.CEST

I assume a failure in your test environment, because it works as designed.

LIST_IN   <== '01|09|WATER|04|VILLAGE|06|UNDERWATER|08|03|02|10'

LIST_SORT <== '01|02|03|VILLAGE|04|05|06|WATER|07|08|UNDERWATER|09|10'
LIST_OUT  <== $regexp(
               $regexp(
                $regexp(%LIST_SORT%,
                 $regexp(%LIST_SORT%,'(?>('%LIST_IN%'))',)
                ,)
               ,'\|+','|')
              ,'\|$',)

LIST OUT    = 01|02|03|VILLAGE|04|06|WATER|08|UNDERWATER|09|10

DD.20150625.0757.CEST

Yes, that takes makes my double spaced format with just one action, for any number od spaces
Thank you for helping me in getting rid of

Replace "GENRE": "    " -> " "
Replace "GENRE": " " -> "  "
Replace "GENRE": "    " -> "  "
Replace "GENRE": "   " -> "  "
Replace "GENRE": "   " -> "  "
Replace "GENRE": "   " -> "  "
Replace "GENRE": "   " -> "  "
Replace "GENRE": "   " -> "  "
Replace "GENRE": "   " -> "  "

Which removed only up to 11 unnecessary spaces and also changed one into two

So what you are saying is, I have to do a workaround: change all the words [or at least cases like WATER / UNDERWATER] to unique set of characters; and run the code in version including those temporary unique changes in the order list?

Because double WATER is immanent and is not to be viewed as an error?

Well, there is a problem within the regular expression, which has not be shown, when using numerical string values in the range from '01' to '99', but might coming up for strings like '101' .
Other text strings like 'WATER' and 'WATERFALL' will show the same problem.
There is no problem for 'WATER' and 'UNDERWATER'.

The failure was in the regular expression, which has evaluated the leading string fragment but not an entire word. Following example now evaluates a word for the comparing.

LIST_IN   <== '111|101|01|WATER|WATERFALL|04|VILLAGE|06|UNDERWATER|03|02|10|11'

LIST_SORT <== '01|02|03|04|05|06|07|08|09|10|11|101|111|UNDERWATER|VILLAGE|WATER|WATERFALL'

LIST_OUT  <== $regexp(

               $regexp(
                $regexp(%LIST_SORT%,
                        $regexp(%LIST_SORT%,'(?>\b('%LIST_IN%')\b)',)
                        ,)
                ,'\|+','|')
               ,'\|$',)

LIST OUT = 01|02|03|04|06|10|11|101|111|UNDERWATER|VILLAGE|WATER|WATERFALL

DD.20150626.1123.CEST

Thank you very much for this code and it's upgrade

I tested it, on real cases, and I could notice only one issue

##90 ##99  SOMETHING-NOT-ON-THE-LIST   ##02   ##01  ##SOMETHING-NOT-ON-THE-LIST

gives

##01  ##02  ##90

instead of

##01  ##02  ##90  ##99

Apparently because it:
1] sees the marker "##"
2] reads "99"
3] continues to read to the next marker [?]
4] compares read value with the list
5] cuts out than long [merged] characters

The hypothetical "SOMETHING-NOT-ON-THE-LIST" should not be there in the first place [and is most probably to be get rid off in this process of cleaning]. But, as proven by this example, it would be better, if the code would look for a marker and then read from its beginning to the last character adjacent to it [somewhat in "as a whole word" way]. Because it is batter to loose only "SOMETHING-NOT-ON-THE-LIST" and "##SOMETHING-NOT-ON-THE-LIST" than a "##listed_number" + "SOMETHING-NOT-ON-THE-LIST"

[And if you're wondering why there are word with numbers and not just numbers, it's because I have to be absolutely sure what words I want to code with numbers. Because one I'll start using numbers, any future change would bring a lot of potential errors coming out from the changed and re-changed codes and difficulty in re-memorizing. Right now I use only some umbers from the range of 1-10 and 50-99, and after dealing with 20% of my files I need to do cleaning / evaluation]

On the other note: there is an visual issue with a too long list