So I've been having a devil of a time getting NES roms and screenshots/titles/box scans with the same filename. First I had the Screenshot Archive image files, but my roms were named differently. Then I found the No-Intro romset, but the images were named incorrectly. I found a set of images, but they are still named slightly differently.
For example, the rom will be named:
Battle of Olympus, The (USA).zip
and the image will be named:
Battle of Olympus, The (U).jpg
They all have that where the rom is named with (USA) and the image is named with (U). I am trying to figure out a way to rename all of the images to match the roms, but I don't know how to do it. Does anyone know enough php or javascript or something, that they could help me write something to do this?
Basically what it would do is this:
1.) Read each file in the 'images' directory.
2.) Get the filename, and search for the string "(U)" or "(J)" or "(E)"
3.) Rename the file (or copy it to a new location with the new name) with "(USA)" or "(Japan)" or "(Europe)"
That would give me the results I need. Anyone have a clue how to do this?