Rain Posted May 8, 2015 Posted May 8, 2015 File Name: Dat-O-Matic Dat File Parser File Submitter: Rain File Submitted: 07 May 2015 File Category: Other Credits: RainDat-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 referenceusing DatProcessor;Initialize the codevar 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 gamesforeach (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 DATgame (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 locatedName - Stores the proper name of the game found in line #2 aboveRomCrc - Stores the CRC value of the rom found in line #3RomSha - Stores the SHA1 value of the rom found in line #3RomMd5 - Stores the MD5 value of the rom found in line #3RomName - Stores the literal name of the rom found in line #3RomSize - Stores the size of the current rom found in line #3RomSerial - 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.