# open the file open my $fh, '<', 'myfile.dat' or die "$!" # translate the data into a 2D array my @rows = map [ split /\s+/ ], <$fh>; # sort on any column my @sorted = sort { $a->[1] cmp $b->[1] } @rows; # print the result print "@$_\n" for @sorted;
I think this will do it here. As in Re: How to sort? noted, this doesn't look like a real "csv" data file.
Regards
mwa
In reply to Re: How to sort?
by mwah
in thread How to sort?
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |