I am trying to extract a specific set of numeric data from a file (which contains both text and numbers) and put it into a separate table which is easier to analyze in JMP. I want the script to work for any number of columns or rows where the data meeting specific criteria might be. What I have come up with is below:
Rowlist = [];
For( i = 1, i <= N Rows( Dtraw ), i++,
If( i == 1,
If( Num( Column( Dtraw, 2 )[i] ) > 0 & Num( Column( Dtraw, 2 )[i] ) < 1000,
Rowlist = Matrix( i )
),
If( Num( Column( Dtraw, 2 )[i] ) > 0 & Num( Column( Dtraw, 2 )[i] ) < 1000,
Rowlist = V Concat( Rowlist, Matrix( i ) )
)
)
);
show(Rowlist);
cols= dtraw<<get column names();
MainData=J(nitems(rowlist),nitems(cols)-1);
For( i = 1, i <= N Items( rowlist ), i++,
For( k = 2, k <= N items ( cols ), i++,
MainData[i,k] = Num( Column( dtraw, k )[rowlist[i]] );
)
);
show(MainData);
Rowlist is the matrix of rows that meet the criteria I need (that is, they are numbers and not text). I want to use this list and "<<get column names" to define the regions of my raw data file where the data I need resides. I want to extract that specific data into a different table. The first For loop for Rowlist works just fine, but the nested for loop does not do what I want and I can't figue out why. Can anyone help me with this?
-Thanks