Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
where the options and their meaning is as givensystem ("sort -n -t , -k 1,3 input_file.txt > ss.txt"); rename (ss.txt, input_file.txt);
All this is done because i need the entire file to be sorted based on the 1st field only. The various fields are seperated by a space and a comma ( ,)... Is there any perl equivalent of the above code-k, --key=POS1[,POS2] start a key at POS1, end it at POS 2 (origin 1) -t, --field-separator=SEP use SEP instead of non- to whitespace transi +tion -n, --numeric-sort compare according to string numerical value
Edited by Chady -- code tags addition to preserve formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: probems with sorting file in perl
by TheEnigma (Pilgrim) on Aug 30, 2004 at 11:53 UTC | |
|
Re: probems with sorting file in perl
by Limbic~Region (Chancellor) on Aug 30, 2004 at 13:02 UTC | |
|
Re: probems with sorting file in perl
by Anonymous Monk on Aug 30, 2004 at 11:27 UTC |