Another approach, if it's really messy, is just clean everything off the front that isn't a number, then renumber it all. Or another, take the metadata track number and use disc number? and track number. But this gives very consistent results, is very fast, and it works on search lists, e.g. .flac for a big CD set with indifferently standardized tracks, but with track numbers present.
Again, it's in the form I use for a multiscript.
Code: Select all
"Standardize Number: # ## ### #### ##-## #-## not beyond 99||| : Std#"
//This standardizes numbers for most music tracks. For 3 and 4 digit numbers, it assumes the first one or two are a CD that belongs before a dash.
//So don't use it if you really want ###dotspace padded, or whatever, i.e. past 99
//Numbers are standardized to: (##-)?##dotspace. Zeros are added for single digits on either of the two halves of the possible dash and CD number.
$debugPreview = ""; //or "p" if you want a preview.
rename r, "^# > ", "$debugPreview"; //Removes initial '#'. Just one.
rename r, "^(\d+)[ .](\d+)([^\d\-].+) > $1$2$3", "$debugPreview"; //Removes any space or dot between initial numbers. Just one.
rename r, "^[\(\[]?((?:[\d\-]{0,4}\d)|(?:[A-Z]\d))[\)\]]?[^A-Z\d\(\[\{]*(.+) > $1. $2", "$debugPreview"; //Clean, add dot space.
rename r, "^(\d)(\. .+) > 0$1$2", "$debugPreview"; //# to 0#; ## OK.
rename r, "^(\d)(\d\d\. .+) > 0$1-$2", "$debugPreview"; //### to 0#-##
rename r, "^(\d\d)(\d\d\. .+) > $1-$2", "$debugPreview"; //#### to ##-##
rename r, "^(\d)-(\d\d) > 0$1-$2", "$debugPreview"; //#-## to ##-##
rename r, "^(\d)-(\d\. .+) > 0$1-0$2", "$debugPreview"; //#-# to 0#-0#