The last time a question like this came up (http://forum.arcadecontrols.com/index.php?topic=41174.0), I posted the following:
I wrote an application for myself for this purpose. I didn't want to remove all of a certain region/option in case that eliminated all versions of a particular game.
If you want to try out my application you can go here: http://pages.sbcglobal.net/kobe/ROMSorter.zip
Sorry for the file size (5 megs), but it contains the CVI LabWindows libraries (so it's like installing VB runtimes). The actual executable is quite small.
This is really only for console ROMS, as existing MAME-specific utilities are far superior for this task.
I've been meaning to throw together some documentation but I have not yet done so. This might be a little confusing. Basically what you can do is assign point values to certain region codes, country codes, and matching artwork files (you supply the artwork paths). You choose a source and destination folder, and the utility will copy the version of each title scoring the most points to the destination folder. You can also specify a point cut-off, so that only the "best" files above this cut-off will actually be copied.
I haven't fully tested this latest version, so I don't know if there are any show-stopping bugs. You can give it a try, and hopefully it'll be of some help. I personally like this method as it lets me choose the criteria for keeping ROMs. Others might prefer a fully automated approach.
I don't think anyone has tried the lastest version of my software yet, but you're welcome to give it a go. If you do use it, let me know if you have any questions.
Say if i wanted to sort all US snes roms to one folder how would i go about going this with ure program??
If you want to keep ALL US roms (including duplicates of the same ROM), then this program is not exactly what you're looking for. There are other utilities out there that will do this for you.
However, if you only want one version of each US ROM, then this program can be very handy. What you have to decide is how to rank the "other" options (the ones in brackets). I call these option codes in my program, and they include the tags such as !, a, b, etc. You can find a list of codes here:
http://www.mameworld.net/easyemu/gtguide.htm#section5To use my program to only keep the US roms, you could do the following:
First you point the source directory to the directory with all SNES roms, and destination to a new folder. The destination should be an empty folder where the "sorted" ROMs will be copied.
In Filename Options, you make sure the right filename extention is included (zip, for example), and then only include the US country codes in the country code section (info found in the above link). You'll want to make sure "U" is included, and also "4". If you also want to assume ROM names with no country code in the filename is also from the US, make sure to create a blank and include it as well. I've also seen some codes that don't appear in the list, like "JU" which I believe means both Japan and US. For any other country codes that are entered but you don't want considered, just don't include them in the sorting (clear the include checkbox). For everything that you have included (the US ROM codes), you can assign the same number of points so that there is no preference between these codes.
The trick for getting rid of the other country codes is to use make sure the exclude checkbox is checked for "Default" at the bottom of the country code section. This will automatically throw out any ROM names that don't match any of the included criteria above, which will toss out all the non-US roms in this case.
Then you have to rank the option codes by assigning points to "!", (blank), "a", and so forth (examples found in the link above). "!" is a perfect dump, so you should assign the most points to that. A blank entry means no option code (no brakets in the filename), and I usually assign this the next-most amount of points. You can choose to assign or not to assign other codes as you like. If you don't want certain types of roms to be considered in the sort, just mark exclude next to that option. You can also exlude the default. This will not consider any roms with option codes not matching what you have already included above (just like the country code section).
Hit Accept and the values will be saved.
If you don't want to have artwork filename matches have an influence on the sorting, then you don't need to touch the "Artowrk Match Options" section.
If you want to enable a point cut-off (only ROMs with point totals above the supplied value will be copied), then you can do so. Otherwise, leave this unchecked and hit "Perform Copy". A box will come up asking if you want to see the sorting results before copying. It's probably a good idea to hit yes.
After the program reads all the filenames and ranks them, you will see a crappy-looking box (I added this in at the end) with the sort results your choices. This will show you which ROMs will be copied, which were excluded from consideration, and which didn't make the cut because another ROM with the same name outranked it. You can then choose to actually perform the copy or quit if you're unhappy with the sort results.
It doesn't hurt anything to run this as long as the destination directory is empty. All the program does is copy files from source to destination. It doesn't delete any files, but it will overwrite any files at the destination that have identical filenames. I can't really imagine when this would be a problem, but it's worth noting.
The end result is that the destination folder will have a unique subset of ROMs based on the criteria you supplied. Once you're happy with the results, you can choose to delete the master set of roms and just use the subset if disk space is a consideration. If you don't want to delete the old ROM directory, just point the frontend to the new ROM directory to take advantage of the sorted list.