in reply to Multiple Sort on a file
which should be read after reading about map, and should be read bottom up. You would call it like this:#! /usr/bin/perl print map {join ",", @$_} sort {$a->[2] cmp $b->[2] or $a->[0] <=> $b->[0]} map {[split /,/, $_, 3]} <>;
perl scriptname < input_file > output_file
|
|---|