Hi, I have table with thousands of rows. I need to be able to select a group of cells in one column, so I could copy it into another table. for example for Column: "Test3 (VOLTS)" only I need to copy cells highlighted in yellow from row 4 thru row 18 using JSL code.
Here is a simple example of one way to do it
Names Default To Here( 1 ); dt = Open( "$sample_data\big class.jmp" ); // copy the names from row 2-6 NameCpy = dt:name[Index( 2, 6 )]; dt2 = New Table( "copied", New Column( "new name", character ) ); dt2 << add rows( 5 ); // copy to new table For( i = 1, i <= 5, i++, dt2:new name[i] = NameCpy[i] );
If you actually have physical rows that are selected, you can easily get their row number with a:
dt<<get selected rows
Hi Jim, how can I select a range of cells withing one column?
for example if I want to select cell 2 thourgh cell 19 within the same column.
Because I want to use this selection to be able to do "Select Matching Cells" within the same column.
Here is the example for "Select Matching Cells" taken from
Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); dt << Select Rows( [1, 2, 3, 4] ); dt << Go To( :Height ); Wait( 2 ); dt << Select Matching Cells();
Jim, I figured it out, here is the code it works.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
L = N Rows( dt ); // number of rows
For( i = 3, i <= L, i++,
dt << Select Rows( i, L );
dt << Go To( :Height );
Wait( 2 );
dt << Select Matching Cells();