Artist starting with numbers


#1

Hello everybody :slight_smile:

My collection is sorted like this:
Music/A/Artist/Year - Album/track.mp3, so for example: Music/B/Beatles/1965 - Help!/Ticket To Ride.mp3

What I’m trying to do now is merge artists starting with numbers (40 Watt Sun, for example) into a folder named “0-9”:
Music/0-9/40 Watt Sun/Year - Album/track.mp3

I have no idea how to solve this…
Thx for any help :slight_smile:


#2

Hmm. I think Picard uses the same functions foobar2000 has.
So your current setup will have something like ...\$cut(%artistsort%,1)\%artistsort\....

You should be able to make that ...$replace(\$cut(%artistsort%,1)\,\0\,\0-9\,\1\,\0-9\,\2\,\0-9\,\3\,\0-9\,\4\,\0-9\,\5\,\0-9\,\6\,\0-9\,\7\,\0-9\,\8\,\0-9\,\9\,\0-9\)%artistsort%\....
If replace only does one replacement, then you could put it inside the \ to make it shorter: ...\$replace($cut(%artistsort%,1),0,0-9,1,0-9,2,0-9,3,0-9,4,0-9,5,0-9,6,0-9,7,0-9,8,0-9,9,0-9)\%artistsort%\....


#3

Ah, checking the scripting doc, it looks like Picard has no $cut() or multi-pair $replace(), but it has $left() and $rreplace(). That should mean ...\$rreplace($left(%albumartistsort%,1),[0-9],0-9)\%albumartistsort%\... does the trick.


#4

Thanks a lot! I made it work now with

$if($eq($rreplace($left(%artistsort%,1),[0-9],0-9),0-9), 0-9/%artist%/...

Seems to work so far :slight_smile: