This is pretty easy. I'd create a directory structure and put all the files that start with A in th a dir, B in b, etc... If there are really a lot of files, I'd have A directory called A with A, B, C, etc. dirs under there. And files that start with ab would go under A/B.