v15 has asked for the wisdom of the Perl Monks concerning the following question:
What i want to do is first arrange column 2 in the descending order of values acoording to column 1 so the result would bea 23 11 b 24 15 c 16 19 d 8 2 e 40 41
Similarly for third and first column it will bee 40 b 24 a 23 c 16 d 8
The output should be like thise 41 c 19 b 15 a 11 d 2
Now in the output the values are basically the line numbers. So for column 2 in the input file a was on 3rd line when we sorted it according to the values. Similarly for b,c,d,e. How can i do this. THanks V15a 3 4 b 2 3 c 4 2 d 5 5 e 1 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: manipulating a data table
by choroba (Cardinal) on Aug 16, 2016 at 16:32 UTC | |
by perldigious (Priest) on Aug 16, 2016 at 17:24 UTC | |
by v15 (Sexton) on Aug 16, 2016 at 19:30 UTC | |
by choroba (Cardinal) on Aug 16, 2016 at 20:29 UTC | |
|
Re: manipulating a data table
by erix (Prior) on Aug 16, 2016 at 17:51 UTC | |
by afoken (Chancellor) on Aug 16, 2016 at 18:14 UTC | |
by kevbot (Vicar) on Aug 17, 2016 at 04:54 UTC | |
|
Re: manipulating a data table
by Anonymous Monk on Aug 16, 2016 at 16:46 UTC |