more useful options | |
PerlMonks |
Re: Sorting a textfile by a date fieldby matthewb (Curate) |
on Oct 01, 2003 at 05:48 UTC ( [id://295520]=note: print w/replies, xml ) | Need Help?? |
How far have you got? There is, as ever, more than one way to do it but if you only have 250 lines to deal with it seems reasonable to get it all into a suitable data structure and then operate on that. It sounds like this will involve little more than splitting on whitespace in a while loop. But what then? Are the dates unique? If so, you could make them keys in a hash and just output it with a sort { date_sorting_code() } keys %hash. But it could be more complicated than that. I reckon if you gave a few sample lines and clarified some characteristics your problem could be solved in a few minutes. MB
In Section
Seekers of Perl Wisdom
|
|