in reply to Working with a very large log file (parsing data out)
If the file is already sorted by date, you can do something like this
my $date = ''; my $count = 0; while (<>) { @data = split(...); if ( $data[3] ne $date ) { if ($date) { print $date, "\t", $count, "\n"; } $count = 0; $date = $data[3]; } $count++; } # Catch the last one print $date, "\t", $count, "\n";
update: forgot last print
--MidLifeXis
|
|---|