#!perl use strict; # Always. my $useage = "perl script.pl column# file1 file2 etc.\n"; my $column = shift @ARGV or die $useage; --$column; # zero base instead of one base. my @input; push( @input, [ split /,/ ] ) while(<>); @input = sort {$$a[$column] cmp $$b[$column]} @input; print join( ', ', @$_ ), "\n" for @input;
In reply to RE: sorting comma separated value file
by Adam
in thread sorting comma separated value file
by taopunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |