Hi Everyone
I have a two data table , table A and table B,
I want write a script that copy last two column data from table A then paste to table B,
Could you give me some kindly sugestion ?
Thanks.
Do the tables have exactly same amount of rows and order of data is exactly the same in both of the tables?
Yes, But I don't know how to use script syntax to copy entire column information to another table.
You can use Join/Update or Data table subscripting . Below is one example using update which might work for you
Names Default To Here(1); // Setup demo dt = Open("$SAMPLE_DATA/Trial1.jmp"); dt2 = Open("$SAMPLE_DATA/Little.jmp"); dt << Delete Rows(5 :: N Rows(dt)); // to make tables equal in size Column(dt2, "batch") << Set Name("B"); // names must be different Column(dt2, "yield") << Set Name("Y"); // names must be different Wait(0); collist = dt2 << Get Column Names("String"); lastcols = Right(collist, 2); dt << Update( With(dt2), Add Columns from Update Table(Eval(lastcols)), Replace Columns in Main Table(None) // important );