in reply to sorting entires by date
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..#!/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"; }
script.pl < inFile > outFile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting entires by date
by Coruscate (Sexton) on Jan 01, 2004 at 23:12 UTC | |
by exussum0 (Vicar) on Jan 01, 2004 at 23:19 UTC |