perl -nle"@t=(sort{(split' ',$b)[1]<=>(split' ',$a)[1]}@t,$_)[0..19]}{print for @t" junk.dat