note
exussum0
<code>
#!/usr/bin/perl
use strict;
use warnings;
my %file = () ;
while(<>)
{
chop;
my( $file, $width, $height, $time ) = split(/:/);
$file{$time} = [ $file, $width, $height ];
}
foreach ( sort keys %file )
{
my $data = $file{$_};
print join(":", ( @$data, $_ ) ) . "\n";
}
</code>
Note, it doesn't work with files that have colons in them. I'm a big fan of letting the command line do stuff... so you'd run it ala..
<code>
script.pl < inFile > outFile
</code>
<div class="pmsig"><div class="pmsig-272750">
<br>
Play that funky music white boy..
</div></div>
318176
318176