Origin Version (Select Help-->About Origin): 7.0 Operating System: Win XP
I want to extract some data with a certain series of row indexs. I have put the required index number in a column, column B. I tried to extract the data with Analysis->Extract worsheet data, and write some equations, but fail.
Related euqations such as "if col(C)[i]==col(B)", "col(C)==col(B)" dont work, where column C is set to be the same as the index in the data, column B is the required index to be extracted.
Can anyone give me some hints on how to solve this problem?
There is no notation that will make an IF statement find the values you want. You would need a script of some kind to mark the necessary rows. Here is one example:
get col(1) -e end1; get col(2) -e end2; wo -a 2; set wcol(wks.ncols-1) -e end1; set wcol(wks.ncols) -e end1; wcol(wks.ncols-1) = 0; wcol(wks.ncols) = 0; loop(ii,1,end) { val=col(2)[ii]; wcol(wks.ncols-1)=col(1)==val?1:0; wcol(wks.ncols)+=wcol(wks.ncols-1); }
which looks for all instances of column 2 values in column 1 and marks a new column with 1. You could then use the new column in a worksheet extraction.