Author Topic: Sorting Roms by Region  (Read 6051 times)

0 Members and 1 Guest are viewing this topic.

Offline Mattroid

  • Deluxe Edition
  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +17/-0
  • So many games, too little time
    • View Profile
    • Arcade Crusade
Sorting Roms by Region
« on: September 07, 2014, 10:13 PM »
Taking a cue from Kyle's thread here, I starting working on a batch file to split a no-intro NES set into folders by region. Right now all it does is split everything based on region exactly as they are specified in the file name. For those that specify multiple regions such as "(Japan, USA)", those will put a copy in both the Japan and USA folders.

Ultimately, my goal was to work towards finding a way to keep one copy of each rom based on preferred regions (meaning, if there's a Japan, a USA, and a Europe version of a single game, I want to keep the USA version and remove the others. If there's only a Japan version, then keep that, etc). I read that this should already be possible using a dat file and ClrMamePro, but I haven't been able to get it to work yet...if anyone can point me in the right direction there, that would be great. If not, then I may continue looking at how to do this with AutoHotKey (which should be easier and possibly faster than creating a batch file). EDIT: I think I figured it out, I just need to play with the settings some and see how best to run through it all. I was using the wrong dat file, basically.

Anyway, for now I figured I'd share this simple batch file that will separate your roms into folders by region, if that's what you want. It can also easily be modified to group some of them together if would prefer (like putting all the smaller regions into one "Other" folder or something if you want). One thing it does not currently do is take the "World" roms and put them into every region folder, though it could be modified to do so pretty easily, if you want. Probably best to have to copy those to Japan, USA, and Europe but not to all the others.

Simply copy the below text into notepad and save with a .bat extension, then run inside your rom folder. As a note, this moves the files, it does not copy, so be sure to make a backup of your set first if you wish. Also, this will work with both uncompressed or compressed roms, so either way you have them setup right now will be fine, so long as you still have the region in the filename. If you'd prefer to have it copy everything instead of move them, once you get this into notepad, just do a find/replace of the word "move" and replace it with "copy". Simple enough.

Code: [Select]
::MAKE FOLDERS
md "USA"
md "Europe"
md "Japan"
md "Asia"
md "China"
md "Germany"
md "Australia"
md "France"
md "Spain"
md "Sweden"
md "Canada"
md "Italy"
md "Brazil"
md "Korea"
md "Russia"
md "World"
md "Unknown"
::MOVE FILES BASED ON COUNTRY
move "*(USA)*.*" "USA"
move "*(Europe)*.*" "Europe"
move "*(Japan)*.*" "Japan"
move "*(Asia)*.*" "Asia"
move "*(China)*.*" "China"
move "*(Germany)*.*" "Germany"
move "*(Australia)*.*" "Australia"
move "*(France)*.*" "France"
move "*(Spain)*.*" "Spain"
move "*(Sweden)*.*" "Sweden"
move "*(Canada)*.*" "Canada"
move "*(Italy)*.*" "Italy"
move "*(Brazil)*.*" "Brazil"
move "*(Korea)*.*" "Korea"
move "*(Russia)*.*" "Russia"
move "*(World)*.*" "World"
move "*(Unknown)*.*" "Unknown"
::COPY AND MOVE FILES FROM MULTIPLE COUNTRIES
copy "*(USA, Europe)*.*" "USA"
move "*(USA, Europe)*.*" "Europe"
copy "*(Japan, USA)*.*" "Japan"
move "*(Japan, USA)*.*" "USA"
copy "*(Asia, Australia)*.*" "Asia"
move "*(Asia, Australia)*.*" "Australia"

Anyway, not sure if anyone else will need/want this, but figured I'd share. In theory, this should work for any No-Intro set for any system. The only thing that I can think of that might propose a problem is if other systems have other regions specified that aren't listed here. If so, those would need to be added. The good thing about moving the files instead of copying them is that if something got missed, then those will still be in your original folder and the file could then be easily updated and rerun to catch whatever was missed.
« Last Edit: February 27, 2015, 07:32 PM by Mattroid »
2600-Harmony Encore; NES-PowerPak, EverDrive N8; GB-EverDrive GB v1; SNES-Super ED v1, SD2SNES; GEN-Mega ED v1; N64-ED64 v2; NGPC-Bung 32Mb, NeoFlashMasta, NeoFlashMasta USB, NGP SD; GBA-EZ-Flash II 256Mb, EZ-Flash IV Redux, ED GBA X5; NDS-R4

Offline DoTheDonkeyKonga

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Sorting Roms by Region
« Reply #1 on: August 19, 2020, 06:17 PM »
Okay, so I know this is an extreme necro post and I'm sorry for that - but I just *had* to reply to say a massive "thank you!!!!!!". This simple script is exactly what I've been trying to achieve. Nice work  :)