is in 1..9, and the filenames are uniformly 8 digits long, you can turn the initial string comparison into a numeric comparison by concatenating the CD number with the file number for purposes of sorting. For example,
Numeric comparisons are faster than string comparisons. If the CD number can be larger than 9, zero pad that part as necessary so that it is a uniform width.