in reply to Re^2: Sorting based on any column
in thread Sorting based on any column
Sorry for not being clear in requirement. Consider my OBJD Array data is like shown below:
I want to create a subroutine which takes two argument as input, First argument is array and second argument is column number on which sorting has to be done. Say for example sort_array is a subroutine and I pass OBJD array and column to sort as arguments. something like sort_array(\@OBJD,2) and this should provide me below output1 ab 2 3 cd 4 5 6 6 9 rc 4 5 ef 6 3 4 1 7 fa 5 2 tg 5 9 9 0 3 bg 3 9 jh 5 2 2 1
1 ab 2 3 cd 4 5 6 6 3 bg 3 9 jh 5 2 2 1 9 rc 4 5 ef 6 3 4 1 7 fa 5 2 tg 5 9 9 0
Or something like sort_array(\@OBJD,6) and this should provide me below output
3 bg 3 9 jh 5 2 2 1 9 rc 4 5 ef 6 3 4 1 1 ab 2 3 cd 4 5 6 6 7 fa 5 2 tg 5 9 9 0
Would like to do it using regular sorting method as well as using 'Schwartzian transform' just to learn it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Sorting based on any column
by aaron_baugher (Curate) on May 20, 2015 at 11:25 UTC | |
by Anonymous Monk on May 21, 2015 at 12:46 UTC | |
by aaron_baugher (Curate) on May 21, 2015 at 13:39 UTC | |
by AnomalousMonk (Archbishop) on May 21, 2015 at 15:08 UTC | |
by aaron_baugher (Curate) on May 21, 2015 at 21:46 UTC | |
by aaron_baugher (Curate) on May 21, 2015 at 13:28 UTC | |
by AnomalousMonk (Archbishop) on May 21, 2015 at 14:27 UTC | |
by dasgar (Priest) on May 21, 2015 at 18:50 UTC | |
|
Re^4: Sorting based on any column
by Anonymous Monk on May 20, 2015 at 11:34 UTC | |
|
Re^4: Sorting based on any column
by Anonymous Monk on May 20, 2015 at 11:23 UTC |