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
 Convert data

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
zfkum Posted - 06/15/2000 : 8:00:00 PM
Hello together,

I have the following problem:

My data look's like this:
X Y
1 1
1 1.23
1 0.99
2 1.87
2 2.03
3 3
3 3.12
3 2.80

and I need the data in the following format (for statistics on rows!)
1 1 1.23 0.99
2 1.87 2.03
3 3 3.12 2.80

What must I do ???

Thx

Mike

3   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/16/2000 : 8:01:00 PM
This script should do what you want. It will copy the data from your original 2-column worksheet to a new worksheet, creating columns and rows when they are needed.

%W=%H;
get col(A) -e npt;
nn=col(A)[1];
win -t D;
col(A)[1]=nn;
col(B)[1]=%W_B[1];
mm=1; kk=0;
loop(ii,2,npt) {
if(%W_A[ii]==nn) {
kk++; wo -v B$(kk);
col(B$(kk))[mm]=%W_B[ii];
} else {
nn=%W_A[ii];
mm++; kk=0;
set %H -er mm;
col(A)[mm]=nn;
col(B)[mm]=%W_B[ii];
};
};

Mike Buess

zfkum Posted - 06/15/2000 : 9:56:00 PM
Hi Craig,

thanks for your answer! The values for each row are variable (1 to ? (I think not more than 10)).

Ciao,

Mike

CStorey Posted - 06/15/2000 : 8:48:00 PM
Hi Mike,

How many possible values for each row? You show a max of 3, can there be more? Is it fixed or does it vary? If it's always 3 then you can use this script.

//Move data from rows to columns C & D
loop(ii, 1, wks.nrows) {

end=list($(ii)+1, Data1_A); end=;
col(C)[$(end)-3]=col(Y)[$(end)-1];
col(D)[$(end)-3]=col(Y)[$(end)];

};

Otherwise it will be a little different.

Craig

[This message has been edited by CStorey (edited 06-15-2000).]


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