go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
I could use some guidance on the best way to tackle a somewhat complex sorting problem I need to work though. I will try to keep this as generic as possible. I have to grab 4 numbers from every line in a file. Each line is formatted in a very predictable pattern. Say I name each number like so:-
$row_lx
NOTE: Many of the $row_lx values will be the same. Here is a nice, neat, golden output. Imagine all of the following lines were originally completely out of order:-
((1.0 0.1) (99.0 0.2)) Notice that the second number (highest priority), $row_ly, always increases, and sometimes it is repeated. When it does repeat, always print the $row_lx numbers in order (second priority). I hope this is clear enough. Any recommendations? I think I need a hash with two primary key values, but I don't know how to sort the hash to produce the above output.
Thanks, In reply to Sorting large sets of geometric coordinates by Anonymous Monk
|
|