Perl: the Markov chain saw | |
PerlMonks |
Re: Sorting a text fileby johngg (Canon) |
on Mar 15, 2007 at 09:56 UTC ( [id://604951]=note: print w/replies, xml ) | Need Help?? |
You could easily adapt the answer I gave to your question yesterday. Simply take out the @wanted array and the $rxExtract regex and replace the
with
Note that I have used a numerical comparison in the sort (<=>) just in case your second column has numbers of other than four digits. If there will always be only four digits you could use string comparison (cmp). I hope this is of use Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|