in reply to comb a logfile for time diff and occourance
And last time you showed me some code;-)
Are you just interested in counting the number of times that TWO occurs in each hour? Just an outline.
my %stats; while ( my $line = <$file> ) { next unless $line =~ /TWO/; my ($time) = $line =~ /^(\d\d\d\d-\w\w\w-\d\d \d\d)/)/; ++$stats{$time}; }
Update: Put $time in () and changed ++$stats{$date} to ++$stats{$time}. Thanks to CountZero for pointing out the error.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: comb a logfile for time diff and occourance
by CountZero (Bishop) on Feb 18, 2008 at 10:51 UTC | |
by hipowls (Curate) on Feb 18, 2008 at 11:21 UTC | |
by CountZero (Bishop) on Feb 18, 2008 at 13:25 UTC | |
Re^2: comb a logfile for time diff and occourance
by Anonymous Monk on Feb 20, 2008 at 03:13 UTC |