in reply to Working With Arrays and Files

If you just have to do it once. . . perl -lne 'my@a=split;push@{$h{$a[5]}},"@a[0..4]\n"}{$"="";print"$_\n@{$h{$_}}"for sort keys%h' infile > outfile
-sauoq
"My two cents aren't worth a dime."