I am looking to produce a report that breaks down the statistics for the various players in different situations. For example lets say this snippet was the entire game. I need to know which quarter the events are taking place in which is clearly defined at the top of the file here. I am not concerned about the kick off action so the first line to parse would be:

1-10-ASH13 (14:30) ASH 48 Hopper ran around right end for 1 yard. Tackled by ORL 94 Whiting, assisted by ORL 54 Schacht.


That line says on 1st and 10 at the Ashveille 13 yard line 48 Hopper ran the ball 1 yard. Now in this game Aheville is the home team so I would essentially want take that information and put it into several "buckets" for the player 48 Hopper. So for example fomr this line we would add information into a "home game bucket" that said he ran once for 1 yard. We would also add that information into a bucket for the first quarter, first half, and 1st down.

For simplicity sakes lets say the next line, which was also a run, was run by Hopper. Then I would just add that information into the home game, 1st quarter, and 1st half buckets, but would have to now drop the new information into a 2nd down bucket since it was on second down.

Is that making it any clearer? I have to deal with penalties which can negate the previous play. The final report would look something like this.

48 Hopper Situation Att Yards Total 2 2 Home 2 2 Away 0 0 1st Quarter 2 2 2nd Quarter 0 0 3rd Quarter 0 0 4th Quarter 0 0 1st down 1 1 2nd down 1 1 3rd down 0 0 4th down 0 0


That is a pretty simplified version of what I am lookig for, but I hope that makes it a bit clearer.

-Prime

In reply to Re^2: Parsing a Log File by PrimeLord
in thread Parsing a Log File by PrimeLord

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.