The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 multiple custom column sorting

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hugh0136 Posted - 05/22/2006 : 12:27:10 AM
Origin Version (Select Help-->About Origin): 7.5 SR4
Operating System: PC

Hello
I have imported numerous data files into the same worksheet. Each data file consists of an x and y column. I want to sort the y column of each data set in descending order while keeping the corresponding x value of each y point next to it. I am currently doing this manually by highlighting A(X1) and B(Y1)
analysis > sort columns > custom > highlighting B(Y1) > descending
and then doing the same for the next set C(X2) and D(Y2).
Is there a way of automating this?
thanks
Rachel

Edited by - hugh0136 on 05/22/2006 12:55:44 AM
2   L A T E S T    R E P L I E S    (Newest First)
hugh0136 Posted - 05/22/2006 : 10:08:17 PM
Thanks works great :)
Deanna Posted - 05/22/2006 : 02:22:53 AM
Hello, Rachel.

You may use Labtalk script to automate the sorting. Suppose you have 3 pairs of x and y columns, and they are arranged in the worksheet like:
X1, Y1, X2, Y2, X3, Y3
Then you can use the following code:

NumPairs=3;
for (ii=0; ii<NumPairs; ii++)
{
XIndex=ii*2+1;
type $(XIndex);
sort -cd $(XIndex) $(XIndex+1) col($(XIndex+1));
};



Paste the code into the Script Window, highlight all the codes and press enter. Then the worksheet will be sorted.

You may change the number of column pairs to suit your need, just by modifying the number (in red) in the first line.

Deanna
OriginLab GZ Office

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000