Copying all roms from a gamelist into a new folder?
Copying all roms from a gamelist into a new folder?
I have a ROM folder of about 3000 games for the PC version of MAME and I want to copy and paste all the roms from it that work with the GP2X 1.6 version of MAME4all according to the gamelist. Is this possible without going through all the names in the gamelist individually? Thanks.
Re: Copying all roms from a gamelist into a new folder?
Assuming you have a text file with the name of each game in it, I'd use a simple shell script. Something like:
$mkdir gp2xcompat; for each in `cat gp2xcompat.txt`; do cp $each.zip ./gp2xcompat; done
If you use windows, you can install cygwin to get bash, or just use this.
$mkdir gp2xcompat; for each in `cat gp2xcompat.txt`; do cp $each.zip ./gp2xcompat; done
If you use windows, you can install cygwin to get bash, or just use this.
We are prepared to live in the plain and die in the plain!
Re: Copying all roms from a gamelist into a new folder?
Oh yeah, it's worth pointing out that MAME roms may change from version to version. If your PC MAME romset is current, and MAME4all forked a while ago, you may have trouble using the newer roms with the older emulator. But I haven't used MAME4all so I don't know for sure. I have run into this problem on MAMEoX.
We are prepared to live in the plain and die in the plain!
- elvis
- 128-bit
- Posts: 910
- Joined: Sun Oct 05, 2008 1:20 am
- Location: Brisbane, Queensland, Australia
- Contact:
Re: Copying all roms from a gamelist into a new folder?
Linux user/lover here (BASH for life), but for the sake of those stuck in Windows land:
Generate yourself a plain text file with the files you want, one per line (however that works - export from an application, copied from a website, whatever). Assuming:
1) Your text file is called "gamelist.txt"
2) Your gamelist.txt has ROM names without the ".zip" extension
3) Your roms live in c:\roms
4) You want to copy the working ROMs to c:\selection
Your win32 command looks like:
for /f "delims=," %I IN (gamelist.txt) DO copy "c:\roms\%I.zip" c:\selection
Obviously chop and change the bits you need to suit your cause. The above will split variables on either newline or on a comma (defined by the "delims"). Again, change to suit your needs.
Also it's worth noting that in Windows2000, the variable is defined as "%%I". In WinXP it switched to "%I". I wouldn't have a clue what's appropriate for Vista or Win7, as I've stayed well away from both (that company turned to shit since Ballmer started running things).
Generate yourself a plain text file with the files you want, one per line (however that works - export from an application, copied from a website, whatever). Assuming:
1) Your text file is called "gamelist.txt"
2) Your gamelist.txt has ROM names without the ".zip" extension
3) Your roms live in c:\roms
4) You want to copy the working ROMs to c:\selection
Your win32 command looks like:
for /f "delims=," %I IN (gamelist.txt) DO copy "c:\roms\%I.zip" c:\selection
Obviously chop and change the bits you need to suit your cause. The above will split variables on either newline or on a comma (defined by the "delims"). Again, change to suit your needs.
Also it's worth noting that in Windows2000, the variable is defined as "%%I". In WinXP it switched to "%I". I wouldn't have a clue what's appropriate for Vista or Win7, as I've stayed well away from both (that company turned to shit since Ballmer started running things).
Re: Copying all roms from a gamelist into a new folder?
Thanks Elvis, that works though I need to delete all the "game title" bits from the gamelist to make it work for everything.
- elvis
- 128-bit
- Posts: 910
- Joined: Sun Oct 05, 2008 1:20 am
- Location: Brisbane, Queensland, Australia
- Contact:
Re: Copying all roms from a gamelist into a new folder?
"Find and replace" in notepad/wordpad/textpad is your friend. 
(I much prefer "sed", but whatever...)
(I much prefer "sed", but whatever...)
Re: Copying all roms from a gamelist into a new folder?
Is it possible to replace every character after the 8th on each line? The ROM files are a max of 8 characters each so that way I could get ri of the lot. That or any word beginning with a capital letter. 
Re: Copying all roms from a gamelist into a new folder?
If you want to get fancy then download perl for windows and do some regex parsing.
Blizzard Entertainment Software Developer - All comments and views are my own and not representative of the company.
- elvis
- 128-bit
- Posts: 910
- Joined: Sun Oct 05, 2008 1:20 am
- Location: Brisbane, Queensland, Australia
- Contact:
Re: Copying all roms from a gamelist into a new folder?
As mentioned, perl and sed will do these sorts of things for you.GagaMan wrote:Is it possible to replace every character after the 8th on each line? The ROM files are a max of 8 characters each so that way I could get ri of the lot. That or any word beginning with a capital letter.
What you need to do is learn regex (Regular Expressions). This is a powerful "language" of sorts that lets you build complex patterns to match (and if you wish, replace) text.
Google "sed regex examples" to get yourself started. If you're a windows user, you can get sed (as well as bash, perl, awk, sort, uniq, and a host of other very cool command-line text-processing tools) via Cygwin:
http://www.cygwin.com/