(STRING,
from position(
add(
first_time_char_from_right( in STRING is K)
,+1)
,max. 10chars long) <- fooled, could be done better
,formatted to 3 digits)
that's it. Should work, hopefully, for sorting, not for replacing your catalog numbers.
and don't forget to replace STRING which what you work with, eg. the catalognumber.
Lets get some things cleared first.
You want to SORT them, you want to RENAME them ???
Following hint.
make use of the help, it's pretty good to help solving such issues.
I'll give some hints, hopefully allowing you to solve it, since it you managed to solve the problem yourself with hints, it's your goal, and you'll be much more happy againt having simply copied a bunch of lines which do tell you nothing at all.
If you did follow suggestion 1 you might already have been stumbled about placeholders such as %artist%, %_filename%, %title%, ....... and now pure guess you could replace 'STRING' with the one you think is the most sensefull one being used for a 'filename'.
Some hints:
$num($mid(%_filename%,$add($strrchr(%_filename%,K),1),10),3)
is nothing but a number found right after the last 'K' being found expanded to 3-digits
$mid(%_filename%,$strrchr(%_filename%,K))
is the last 'K' found on it's own
both of these combined would for example if you an output in the form Kxxx no matter if the input was K1 K22 K555
$left(%_filename%,$strrchr(%_filename%,K))
gives you left part of something till within the last 'K' found, in other word everything apart from the numbers after the last 'K'
$left(%_filename%,$sub($strrchr(%_filename%,K),1))
gives you same as above but without the 'K'
My advice is as following: create a bunch of columns within mp3tag and put each of the examples into their value fields, and see what get's displayed.