how to sort the file in specified folder

hi
im having soo many .top files and i have to sort a set of files in one folder like tat so many sets of folders have to be created ... like say i have the file name j1 , g2 ,s3,k4,h1,j2,k3,s4..And i have to create one folder in tat i to have copy the files j1, g2 ,s3,k4 in one folder and again same another set in another folder , like tat im having some 500 files ,which has 1,2,3,4,etc

and i put it into an array ,so all the files are in the array ....