The online racing simulator
Simple MPR Parser
(16 posts, started )
#1 - maczo
Simple MPR Parser
hi all,
i've written this simple parser to automate the process of creating results in a nice table. well, whether it is nice or not is arguable (depends on what you like - the output is plain text, although formatted properly [edit: now also output in comma-separated values "format"]). long story short - a small program for lazy people made by another lazy person (thats why it doesnt find racers who didnt finish the race) [edit: now it can!]. a good thing though is that you can use it in two ways:
1. parse a single mpr (race) file
2. parse a pair of mprs where one is from qual and the other from race (one combined table is generated then)

enjoy!
maczo

ps some help on usage is in the files "readme.txt" and "points.txt" - read carefully once and you should have no problems with using this
Attached files
parser.zip - 104.4 KB - 381 views
Looks good, will give it a whirl.
I'm the laziest person in MPT..so it's a great help..and works fine for me.
Nice tool, would it be too much to ask to add the output as a csv file?
#5 - maczo
a what?
no, really, i don't know what a csv file is, so perhaps some hints?
comma seperated values

use either , or ; to seperate a bunch of... values

text1;text2;value1;value2;value3;cheatedWRtime1;etc1;etc2;etc3
#8 - maczo
ah, thanks. i think this isn't much work, BUT... as with finding the racers who didnt finish - it will have to wait for me to have some time. now it's student hunting season at uni ... and then perhaps i'll do some skiing during the break.
#9 - ikkah
Don't want to steal your thread or anything, but here's my parser:

Executable: http://www.lfs-suomi.com/uploads/mpr-parse.exe
C++ source: http://www.lfs-suomi.com/uploads/mpr-parse.cpp

It can find drivers that didn't finish, with a few exceptions. It prints an ugly HTML-file that's supposed to look a bit like the results board in LFS. The code is a bit hacky, since I thought I'd never show it to anyone, but if you want to modify it for your own purposes, I'm not stopping you.
Quote from ikkah :Don't want to steal your thread or anything

well i sure hope so. anyway mine is bigger erm... i mean better and tidyer and its output is NOT html
jk, hope everyone will choose what suits them most
ok, i had some time to improve the program. now it finds drivers who didnt finish and it also outputs in csv format (i hope ). hope to see some feedback from you guys.

ikkah, are you sure you placed all lines of code referring to output? im quite convinced that your parser doesnt output drivers who didnt finish (although i dont doubt it FINDS them - stole some code btw, hope you dont mind ).

cheers,
maczo

P.S. new version in first post ofcourse
P.P.S question about csv - should i include all information like in .txt output (track name, no. of drivers, no. of laps) or should it only include row-by-row info starting from 1st racer?
Quote from maczo :ikkah, are you sure you placed all lines of code referring to output? im quite convinced that your parser doesnt output drivers who didnt finish (although i dont doubt it FINDS them - stole some code btw, hope you dont mind ).

Hehe, whoops! It does find those drivers, but doesn't actually save them anywhere. Steal as much code as you want to, if it does good for the community, it does good for me
ok, once more i had to upload a new version due to some small bugs. get it from post 1, again. enjoy!

ikkah - so are you going to include this almost-implemented feature? i think people would appreciate it
Uhm, your parser does that now, right? If there's a parser doing that already, I don't see why I should add that feature to my parser. It's meant to imitate the results table in LFS anyway, and DNF drivers aren't listed there either.
well, yes it does, but someone might prefer to copy-paste the html code into his site rather than find out how to make the text table look good (multiple spaces problem) and then color it to fit his needs. you know, having a choice is usually better, and as for lfs tables functionality - its not bad to make something better, or at least making it meet popular needs
ok, today i hope the last update. i found one more situation in which some players might have been skipped by the parser, i also fixed a minor error in csv output.
i also would like to mention that i dont have enough replays to do decent testing, so if something goes wrong please let me know.

cheers,
maczo

Simple MPR Parser
(16 posts, started )
FGED GREDG RDFGDR GSFDG