I am building out a parser for a well-known track & field meet management software output file (sample output).
I can parse this manually, and put items into my object model (overview below), but it's a bit time intensive, and it's going to have manual issues.
FYI, I'm using C# but I have no problem crossing boundaries into better/more appropriate languages here.
I've tried/thought about a couple different ways at this, and they are all just meh.
- Use a
StringReaderto parse each line, one-at-a-time, until I run into the "event separators", then try to gather that data together. Parse after.
- Use a
Regex.Splitagainst a regex that looks something like
Event\s+\d*\s+(Girls|Boys)\s+(.*)\n[=]+\n(.*)\n[=]+to split the input string into similar chunks. Parse after.
- Use Amazon Mechanical Turk and hiring a small army of humans to do this work for me.
- Suck it up and keep doing this manually.
So, it's entirely possible that I'm going about this all wrong, and I should be using some language/pattern/concept that I don't even know exists. Any help here would be greatly appreciated.
Keep in mind that I don't actually need the code to do the parsing, I am just looking for the idea behind it.
The (simplified) object model looks something like this:
- Graduation Year
- Data (the actual time, height, or distance)