in reply to Parsing a Log File

This might form a starting point. You'll to tweak the regexes in the light of what the rest of the logs look like and add extra if you want to record timings, offsides etc.

#! perl -slw use strict; use Data::Dumper; #local $/ = ''; my %stats; while( $_ = <DATA> ) { chomp; $stats{$1}{$2}{$3} += $4 if m[ ([A-Z]{3}) \s+ # Team ( \d{2}\s[A-Za-z]+ ) \s+ # Player (ran|kicked|pass completed|returned) # Action .*? (\d+)\syards? ]x; $stats{$2}{$3}{$1}++ if m[ (Tackled|assisted|block) #action .*? by\s+([A-Z]{3}) \s+ # Team ( \d{2}\s[A-Za-z]+ ) # Player ]x; } print Dumper \%stats; __DATA__ Beginning of First Quarter. ORL 13 Sauls kicked off 71 yards from the ORL30. ASH 22 Noa returned the ball 14 yards to the ASH13. Tackled by ORL 82 Ferguson. Possession to Asheville. 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. 2-09-ASH14 (13:59) ASH 23 Theriot ran inside the left guard for 1 ya +rd. Tackled by ORL 96 Dugger. 3-08-ASH15 (13:25) ASH 18 Hall pass completed to 23 Theriot for 10 y +ards. Tackled by ORL 96 Dugger. -- 1-10-ASH25 (12:50) ASH 38 Dollinger ran around right end for 6 yards +. Tackled by ORL 95 Gonzalez, assisted by ORL 54 Schacht. Key block delivered by ASH 77 Cassell. 2-04-ASH31 (12:05) ASH 18 Hall pass was overthrown, intended for 81 +Perry. Penalty: ORL - Offsides. --

Output

[19:23:58.26] P:\test>410999 $VAR1 = { 'ASH' => { '77 Cassell' => { 'block' => 1 }, '38 Dollinger' => { 'ran' => '6' }, '23 Theriot' => { 'ran' => '1' }, '48 Hopper' => { 'ran' => '1' }, '22 Noa' => { 'returned' => '14' } }, 'ORL' => { '95 Gonzalez' => { 'Tackled' => 1 }, '94 Whiting' => { 'Tackled' => 1 }, '96 Dugger' => { 'Tackled' => 2 }, '82 Ferguson' => { 'Tackled' => 1 }, '13 Sauls' => { 'kicked' => '71' } } };

Examine what is said, not who speaks.
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon