cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install 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