
August 23rd, 2012, 01:57 PM
|
|
|
|
Hi,
I think you will have to:
- split the output into an array of lines
- split each line into an array (so you'll have to manage an array of arrays)
- sort numerically the first array according to the 8th element of the second
- merge everything back together.
Only the sort is a bit complicated, because you'll need to write your own compare routine (a function or a block) to pass it to the sort function. This could look like something like that:
sort { $a[7] - $b[7] } @array ...
The point is that the sort function needs a piece of code that will return a positive number is $a > $b, a negative number if $b > $a, and 0 if they are equal.
|