Another approach uses sort without transposes
t1=:<;._2@:(,&' ');._2
(,.~<"0@>:@[EMAIL PROTECTED])(\:".@>@{:"1) t1 t NB. almost the same result
+-+-+---+---+-----+
|1|3|ccc|5 |5 |
+-+-+---+---+-----+
|2|2|bbb|2 |1 |
+-+-+---+---+-----+
|3|6|fff|100|1 |
+-+-+---+---+-----+
|4|4|ddd|22 |0.987|
+-+-+---+---+-----+
|5|5|eee|1 |0.987|
+-+-+---+---+-----+
|6|7|ggg|20 |0.4 |
+-+-+---+---+-----+
|7|1|aaa|10 |0.2 |
+-+-+---+---+-----+
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm