Bash is great for these kind of things, and MiSTer has it of course. Here's a short script that does this:
Code: Select all
mkdir {A..Z}
for i in {A..Z} ; do
mv "$i"?* "${i,}"?* "$i/"
done
mkdir -p 1
for i in ??* ; do
mv "$i" 1/
done
rmdir 1 {A..Z} # remove empty folders
It may spit a few errors that can be ignored. This one doesn't create 0, 1, ..., 9 folders or the "_others" folder, it would be easy to do but I personally prefer to have everything with numbers and symbols in the same folder, since there are usually very few of them to justify such segregation. So everything not alphabetic goes to the 1/ folder.
But for ROMs and tapes, I prefer to zip the stuff and have 1.zip, A.zip, B.zip, C.zip and so on. Sometimes for floppies too, but keep in mind that writes to floppies won't be stored. This script will do the trick:
Code: Select all
for i in {A..Z} ; do
zip -9m "$i".zip "$i"* "${i,}"*
done
zip -9m 1.zip [!A-Za-z]*
As for how to use these, you can just copy them to a file in the MiSTer's Linux and then, from bash, run 'source <file>' on the folder with the ROMs. Or if you can copy/paste the commands directly to an SSH session, that works too.