Rain Posted March 21, 2013 Posted March 21, 2013 Today I am making public my Dat-O-Matic dat file parsing system which I created for a very special project that I am working on; I figured it would save some of the developers out there several hours of leg work creating their own. Currently it parses UTF/Text dat files found on http://datomatic.no-intro.org/ I plan on adding functionality of allowing it to parse XML/Text type DAT files at some point in time. Without further delay here is how you use this bad boy. Include a reference using DatProcessor; Initialize the code var myMethod = new DatFileProcessor(); var myGames = myMethod.ProcessFile(@"c:\path\to\my\datfile.dat"); This will read your DAT file into an object type that will be held much like a list type, and here is a quick and dirty way to loop through all of the data that can be found from that DAT file. Looping through games foreach (var myGame in myGames) { Console.WriteLine(myGame.Index); Console.WriteLine(myGame.Name); Console.WriteLine(myGame.RomCrc); Console.WriteLine(myGame.RomMd5); Console.WriteLine(myGame.RomName); Console.WriteLine(myGame.RomSha); Console.WriteLine(myGame.RomSize); Console.WriteLine(myGame.Serial); } Overview - The Layout of a DAT game ( name "Circus Attractions (Europe) (Compilation - Milestones)" description "Circus Attractions (Europe) (Compilation - Milestones)" rom ( name "Circus Attractions (Europe) (Compilation - Milestones).ipf" size 928295 crc 83BA36E2 md5 1B54BFAA5325EC1D654BF035299B0CCF sha1 516672412F3532F823088FD71A669D30E226D5CA ) ) Index - Stores the line number within the file where the game has been located Name - Stores the proper name of the game found in line #2 above RomCrc - Stores the CRC value of the rom found in line #3 RomSha - Stores the SHA1 value of the rom found in line #3 RomMd5 - Stores the MD5 value of the rom found in line #3 RomName - Stores the literal name of the rom found in line #3 RomSize - Stores the size of the current rom found in line #3 RomSerial - When applicable this will store the value of a games serial (typically found in line #3/#4) Anyways ladies and gents, I just wanted to spread my works for any of our brilliant software developers out there who need a quick and simple way of parsing DAT files; I will add a searching algorithm in later as well. Thanks everyone! BECOME PLATINUM TODAY! DatProcessor.zip
emb Posted March 22, 2013 Posted March 22, 2013 I think i might nab this from you. Thanks! %5BSIGPIC%5D[/sIGPIC] Download HyperSpin Tools and check out my MAME cabinet
goldorakiller Posted March 25, 2013 Posted March 25, 2013 The dll is not .net native ? PRO-EVO Editing Studio 2013
Gothicplsur Posted March 25, 2013 Posted March 25, 2013 Rain, I Have A Question... My SNES Roms Folder When Scanned With The DAT From Hyperlist Shows 787 "Would Be" Roms Available, Then From DAT-O-MATIC's DAT There's A 3,546 "Would Be" Rom Count, So My Question Is, If A Person Is Using Hyperspin And It's DAT Of Only 787 Roms Available. Is This Because Of Duplicates From Other Countries, If So, And I Would Only Prefer To Have (USA) Roms (no offense to other countries) The DAT From Hyperlist Is The Only Way Say, Myself Should Go...?!?
emb Posted April 9, 2013 Posted April 9, 2013 Just thought I would let you know, I am using this API in my 4.2 release. It has saved me a couple hours of effort. Thanks Ron! %5BSIGPIC%5D[/sIGPIC] Download HyperSpin Tools and check out my MAME cabinet
RodentVienna Posted April 9, 2013 Posted April 9, 2013 thanks ron, much appreciated! kind regards alex
goldorakiller Posted April 9, 2013 Posted April 9, 2013 The dll is not .net native ? PRO-EVO Editing Studio 2013
emb Posted April 9, 2013 Posted April 9, 2013 As far as I can tell from using it, yes. Sent from my iPhone using Tapatalk %5BSIGPIC%5D[/sIGPIC] Download HyperSpin Tools and check out my MAME cabinet
goldorakiller Posted April 9, 2013 Posted April 9, 2013 As far as I can tell from using it, yes.Sent from my iPhone using Tapatalk Yes it is .net native or yes it is NOT .net native ? PRO-EVO Editing Studio 2013
emb Posted April 9, 2013 Posted April 9, 2013 Yes it is .net native Sent from my iPhone using Tapatalk %5BSIGPIC%5D[/sIGPIC] Download HyperSpin Tools and check out my MAME cabinet
Rain Posted May 7, 2015 Author Posted May 7, 2015 File Name: Dat-O-Matic Dat File Parser File Submitter: Rain File Submitted: 07 May 2015 File Category: ROM/Database/Renaming tools Credits: Rain Today I am making public my Dat-O-Matic dat file parsing system which I created for a very special project that I am working on; I figured it would save some of the developers out there several hours of leg work creating their own. Currently it parses UTF/Text dat files found on http://datomatic.no-intro.org/ Without further delay here is how you use this bad boy. Include a reference using DatProcessor; Initialize the code var myMethod = new DatFileProcessor();var myGames = myMethod.ProcessFile(@"c:\path\to\my\datfile.dat"); This will read your DAT file into an object type that will be held much like a list type, and here is a quick and dirty way to loop through all of the data that can be found from that DAT file. Looping through games foreach (var myGame in myGames){Console.WriteLine(myGame.Index);Console.WriteLine(myGame.Name);Console.WriteLine(myGame.RomCrc);Console.WriteLine(myGame.RomMd5);Console.WriteLine(myGame.RomName);Console.WriteLine(myGame.RomSha);Console.WriteLine(myGame.RomSize);Console.WriteLine(myGame.Serial);} Overview - The Layout of a DAT game (name "Circus Attractions (Europe) (Compilation - Milestones)"description "Circus Attractions (Europe) (Compilation - Milestones)"rom ( name "Circus Attractions (Europe) (Compilation - Milestones).ipf" size 928295 crc 83BA36E2 md5 1B54BFAA5325EC1D654BF035299B0CCF sha1 516672412F3532F823088FD71A669D30E226D5CA )) Index - Stores the line number within the file where the game has been located Name - Stores the proper name of the game found in line #2 above RomCrc - Stores the CRC value of the rom found in line #3 RomSha - Stores the SHA1 value of the rom found in line #3 RomMd5 - Stores the MD5 value of the rom found in line #3 RomName - Stores the literal name of the rom found in line #3 RomSize - Stores the size of the current rom found in line #3 RomSerial - When applicable this will store the value of a games serial (typically found in line #3/#4) Anyways ladies and gents, I just wanted to spread my works for any of our brilliant software developers out there who need a quick and simple way of parsing DAT files; I will add a searching algorithm in later as well. Thanks everyone! Click here to download this file
Recommended Posts
Archived
This topic is now archived and is closed to further replies.