cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. ET on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

Script

Bonjour à tous,
 
Voici ma base de données :
 
hcarr01_0-1689602768402.png

 

 
J’aimerais pouvoir supprimer toutes les colonnes (de la 4ème à la dernière colonne).
J’utilise le script suivant mais cela ne fonctionne pas correctement.
 
dt22 = current data table();

max = N cols(dt22);
For (i=4 , i <= max , i++, dt22 << delete columns(i); );
Merci pour vos réponses !
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Script

Easiest is most likely to use list of columns to remove with Delete Columns

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

col_names = dt << Get Column Names("String");
Remove From(col_names, 1, 4);
wait(2); // for demo purposes
dt << Delete Columns(col_names);

If you want to use For loop, loop from the end to avoid issues with indices changing.

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Script

Easiest is most likely to use list of columns to remove with Delete Columns

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

col_names = dt << Get Column Names("String");
Remove From(col_names, 1, 4);
wait(2); // for demo purposes
dt << Delete Columns(col_names);

If you want to use For loop, loop from the end to avoid issues with indices changing.

-Jarmo

Recommended Articles