Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Need file processing tool or help with DOS batch command  (Read 1480 times)

0 Members and 1 Guest are viewing this topic.

jimmer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:February 17, 2025, 02:48:38 pm
  • I want to play Defender like at the arcade.
Need file processing tool or help with DOS batch command
« on: July 05, 2014, 05:39:23 am »

Can someone write me a batch file to do this please?

I've got a folder with 30000 snap images.
And I've got a text list of 3000 games I'm (at least possibly) interested in.
I want to copy the matching 3000 snaps to a new folder.


Or point me to existing tools,

or point me to a collection of snaps that doesn't include all the dross.

TVM

On forums jimmer speaks for himself as a Defender fan, not as proprietor of www.jbgaming.co.uk  << Is that advertising or disclosure ? or both ?

adder

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 640
  • Last login:February 04, 2021, 10:51:51 am
  • Location: Easy St.
Re: Need file processing tool or help with DOS batch command
« Reply #1 on: July 05, 2014, 06:02:37 am »

i use a free program called textcrawler to do this sort of thing

i can create the batch file you require but you will need to attach/send me the 3000 games list

ps. are you using windows xp?

jimmer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:February 17, 2025, 02:48:38 pm
  • I want to play Defender like at the arcade.
Re: Need file processing tool or help with DOS batch command
« Reply #2 on: July 05, 2014, 06:10:43 am »

thanks, I'll have a look at textcrawler.

Here is an example txt file.  I might want to do this again, but keen to see what you provide.

This will be run in windows7    (build my mame setups on win7and run them on winXP)
On forums jimmer speaks for himself as a Defender fan, not as proprietor of www.jbgaming.co.uk  << Is that advertising or disclosure ? or both ?

adder

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 640
  • Last login:February 04, 2021, 10:51:51 am
  • Location: Easy St.
Re: Need file processing tool or help with DOS batch command
« Reply #3 on: July 05, 2014, 06:33:40 am »
ok i will give this a go now
quick question though as i dont use snap images, are they all in .png format?

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Need file processing tool or help with DOS batch command
« Reply #4 on: July 05, 2014, 06:38:02 am »
Quite easy to do in C#. You can get yourself a copy of Visual Studio Express and write a simple program to do this.

Eg.
Code: [Select]
private void Form1_Load(object sender, EventArgs e)
{
string[] lineArray = File.ReadAllLines(Path.Combine(Application.StartupPath, "mame_d248_5474_games.txt"));

foreach (string lineString in lineArray)
{
string fileName = String.Format("{0}.png", lineString);
string sourcePath = Path.Combine(@"C:\MySourceFolder", fileName);
string destPath = Path.Combine(@"C:\MyDestFolder", fileName);

if(File.Exists(sourcePath))
File.Copy(sourcePath, destPath, true);
}
}

adder

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 640
  • Last login:February 04, 2021, 10:51:51 am
  • Location: Easy St.
Re: Need file processing tool or help with DOS batch command
« Reply #5 on: July 05, 2014, 06:49:49 am »
here you go assuming you are using .png images
i used textcrawler to do it, once you are used to it its quick and easy
note: make a folder called 'copied' in your main folder of .png snap images, before running the batch file in your main folder of .png snap images
batch file is attached in the .zip:
« Last Edit: July 05, 2014, 08:45:20 am by jadder »

jimmer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:February 17, 2025, 02:48:38 pm
  • I want to play Defender like at the arcade.
Re: Need file processing tool or help with DOS batch command
« Reply #6 on: July 05, 2014, 09:42:05 am »
Thanks for both of those.

jadder: not elegant!  but it's the sort of thing I used to do (I'd use unix parsing commands to change a list into a list of actions). I've got textcrawler now, might come in useful.

headkaze: That what I was hoping for but as .bat     I might look into VSE but I don't know C, so probably won't at this time.


I'll admit I ended up reverting to my trusty old excel macros to do the job.
(change ext to .xlsm) if you want to use it.
On forums jimmer speaks for himself as a Defender fan, not as proprietor of www.jbgaming.co.uk  << Is that advertising or disclosure ? or both ?

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Need file processing tool or help with DOS batch command
« Reply #7 on: July 05, 2014, 11:01:44 am »
It's a shame Jimmer.. I was trying to teach you how to fish ;)

PS: I could write you a DOS batch file to do the same. I just think you're better off learning C#

jimmer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:February 17, 2025, 02:48:38 pm
  • I want to play Defender like at the arcade.
Re: Need file processing tool or help with DOS batch command
« Reply #8 on: July 05, 2014, 12:45:07 pm »

thanks headkaze, but I don't have time right now :) 

I got started on python a coupe of years ago but once I'd done what I needed it for,  it's nearly all forgotten now. I should probably have dug that out for this task.
On forums jimmer speaks for himself as a Defender fan, not as proprietor of www.jbgaming.co.uk  << Is that advertising or disclosure ? or both ?

spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
Re: Need file processing tool or help with DOS batch command
« Reply #9 on: July 05, 2014, 02:37:20 pm »

thanks headkaze, but I don't have time right now :) 

I got started on python a coupe of years ago but once I'd done what I needed it for,  it's nearly all forgotten now. I should probably have dug that out for this task.

I was gunna say.......it'd be a very short python program.  :)

Open file and read by line
try
  copy file by name in line
except (if not there, who cares)
  pass
close file

jimmer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 562
  • Last login:February 17, 2025, 02:48:38 pm
  • I want to play Defender like at the arcade.
Re: Need file processing tool or help with DOS batch command
« Reply #10 on: July 06, 2014, 06:12:44 am »

And finally;

My example list came from ROMlister. Which, I've just spotted, also has the option of outputting a batch file!
On forums jimmer speaks for himself as a Defender fan, not as proprietor of www.jbgaming.co.uk  << Is that advertising or disclosure ? or both ?

NOP

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 916
  • Last login:September 19, 2017, 08:22:27 pm
  • I stole my avatar.
    • winterMAME
Re: Need file processing tool or help with DOS batch command
« Reply #11 on: July 06, 2014, 10:33:49 am »
yep, that would have done the trick nicely...

copy %ROM%.png c:\mame\snaps

http://wiki.arcadecontrols.com/wiki/RL_tutorial_batchFiles

Sorry you got there a bit too late- you already had the tool in your toolbox.