comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » how to sort data based on other sorted data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
how to sort data based on other sorted data [message #58013] Wed, 09 January 2008 11:24 Go to previous message
placebo is currently offline  placebo
Messages: 3
Registered: January 2008
Junior Member
Hello all,

I have an input file containing coordinate data (three columns) with a
couple thousand rows. In order to keep this post short lets say the
data file has 8 coordinates scrambled in the list, and I want to sort
it first by the 'z' coordinate (3rd column) then by the 'y' coordinate
(2nd column) then finally by the 'x' column. for example:

unsorted:
x y z
- - -
2 1 2
1 2 2
2 1 1
1 1 1
1 2 1
2 2 2
1 1 2
2 2 1

sorted:
1 1 1
2 1 1
1 2 1
2 2 1
1 1 2
2 1 2
1 2 2
2 2 2

I've already written a routine that will perform this calculation but
it involves using 3 nested FOR loops. So, here's a challenge to you
all. Can you figure out a way to do this without using any FOR loops?

Cheers,

Placebo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: image on map
Next Topic: Statistics : T-test, P-value

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:13:34 PDT 2025

Total time taken to generate the page: 0.00469 seconds