[CentOS] Text Proccessing script - advice?

Tue Dec 21 20:45:34 UTC 2010
Les Mikesell <lesmikesell at gmail.com>

On 12/21/2010 1:58 PM, Roland RoLaNd wrote:
>
> the only thing missing is to find a way to just take the earliest time of each day.
>
> in other words the above output should be:
>
>
>        0 DaysLate
>

That means my perl script was wrong... This looks more like what you 
want, except for your last change to 9:10.

my %id_count;
my %id_date; #date already seen;
my %iddate_time; #1st time each day
while (<>) {
my  ($x,$id,$date,$time,$junk) = split /,/;
   next if ($x == 'X'); #skip header
   $iddate_time{$id . $date} = $time unless ($iddate_time{$id . $date}); 
#store earliest
   next if ($time le  "09:00:00");  # not late
   $t = $iddate_time{$id . $date};
   next if ($iddate_time{$id . $date} le  "09:00:00"); # 1st wasn't late
   next if ($id_date{$id} eq $date);  # already counted today
   print "Late: $id - $date - $time\n";
   $id_count{$id}++;
   $id_date{$id} = $date;
   }
print "----\n";
while (( my $id,$count) = each(%id_count)) {
print "$id late $count days\n";
}

-- 
   Les Mikesell
    lesmikesell at gmail.com