I have been able to do the first part (copy) but I am struggling with the second (multiply) part. Any direction is appricated. My example script is below.
Names Default To Here( 1 );
bcdt = Open( "$SAMPLE_DATA\Big Class.jmp", invisible ); //load a data-table
myNewdt = New Table( "Parameters Table", //create a new data-table
Add Rows(8),
New Column( "Parameter" ),
New Column( "H", Numeric),
New Column( "W" ),
);
Column(myNewdt, "Parameter")[1] = "A";
Column(myNewdt, "Parameter")[2] = "B";
Column(myNewdt, "Parameter")[3] = "C";
Column(myNewdt, "Parameter")[4] = "D";
Column(myNewdt, "Parameter")[5] = "E";
Column(myNewdt, "Parameter")[6] = "F";
Column(myNewdt, "Parameter")[7] = "G";
Column(myNewdt, "Parameter")[8] ="I";
vals = Column(bcdt, "height")[4::11]; //get the values to be copied. Note data type becomes "character"
//show (vals);
For( i = 1, i <= N Items(Vals), i++, //copy values
:H[i] = vals[i]
);
The above script copies the values in column "height" of data file bcdt to column "H" of another data file myNewdt. However, I want for e.g. the 9th and 10th row entries in column "height" of bcdt to be multiplied by a constant number, say 0.0001 and pass it on to the same rows (9th & 10th) of column "H" of the other data file myNewdt. The other row values are to be copied unmodified. How to achieve this?
Hi Neo
My script as annex. Hope it can help you to sovle the issue.