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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Convert data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zfkum

Germany
6 Posts

Posted - 06/15/2000 :  8:00:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

CStorey

Canada
137 Posts

Posted - 06/15/2000 :  8:48:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

Go to Top of Page

zfkum

Germany
6 Posts

Posted - 06/15/2000 :  9:56:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Craig,

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

Ciao,

Mike

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/16/2000 :  8:01:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000