I have a stats app that I record a volleyball match onto. It allows me to send a raw report (gamenotes.txt) of what actions occurred within the game.
A volleyball set is won when one team gets to 25 first, but they must win by 2 points. A full match is best of 3 or best of 5, depending on the venue/format. This example is a report from the women's USA match vs Thailand. It is just the first set, however. But I think it's a good representation of what could be included.
Each line of the report will begin with the score (0-1) followed by a series of actions that occurred during that one rally. Each action will have the player's jersey number in parenthesis (unless it's an opponent action, then the 'jersey' will be "THEM").
(0-1), SR-3( 2), AT(13), BE(25),
A serve came from the opponent and was rated a '3' (SR = serve reception), recorded by player 2. Player 13 Attempted (AT) to terminate the rally but failed. Finally player 25 recorded a blocking error (BE).
It's fairly easy to read for the most part, but here's where it gets tricky. If an action is entered incorrectly, the app doesn't remove it, it records it with a preceding minus sign.
The score is 9-12. #10 serves (S). OOPS - not #10...fix that. #13 was the server! #23 gets a recorded dig (D) and #23 ends the rally with a hitting error (E).
The down side is that the correction may not immediately follow the goof. :( So it may require working backwards until the exact same action/player combination is found.
I have most of the code written for what I'm doing so far. However, I ultimately want to evolve this into something helpful for reporting on the statistics. For example, If #13 at the end of the set/match has 20 attempts, kills 15 of those and only errors once, I would want to display her hitting % which is calculated by (K-E)/AT, or in this case 70%.
I'll just upload the report file for now in case someone wants to come up with their own solution for looping through the data. But I'll be glad to post my current script if desired.