cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Pro extension simulates Bayesian Optimization runs. Prediction formulas stand in for experimental results. Run simulations and compare results. Download and use the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
cz1
cz1
Level I

script - delete or reorder colums

hi,

 

I would like to add "delete multiple columns" or "reorder multiple columns" to my script.

How can I code this into my scripts?

JMP help provides a simple description for a single column, but I can't do it manually for more than 100 columns.

Thank you in advance

 

A++

 Zdenek

 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt:height << Set Selected;
Wait(2);
dt << Delete Columns();

Edit (jthi): added jsl formatting

 

1 REPLY 1
jthi
Super User

Re: script - delete or reorder colums

Do you wish to reorder/delete columns based on user-selection or list in the script? 

Using list (Delete Columns )

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

cols_to_delete = {"height", "weight", "age"};
dt << Delete Columns(cols_to_delete);

Selection

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols_to_delete = {"height", "weight", "age"};
dt << Select columns(cols_to_delete);
dt << Delete Columns();

Reordering

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols_to_reorder = {"height", "weight", "age", "name"};
dt << Move Selected Columns(cols_to_reorder, To Last);

JMP's Scripting Index does sometimes have nice examples so it is a good starting point when scripting JMP.

-Jarmo

Recommended Articles