in reply to Comparing Dates and Reoccurance
The algorithm won't be hard if you can say what you're aiming for. Doesn't have to be a formal statement of requirements, an example is fine as long as it covers the obvious questions.
I'll go ahead and assume the input log is sorted by timestamp and in fixed-width format.
# see manpage for unpack my $TEMPLATE = 'A20 @28A9'; # read the input log into a hash my %last_time; while (<DATA>) { my ($timestamp, $id) = unpack $TEMPLATE; $last_time{$id} = $timestamp; } # print the output log # I have omitted the header for my $id (sort keys %last_time) { print "$id\t$last_time{$id}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |