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. EST 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
ShahirahLoqman
Level II

How do I Script to Change Selected Column Names

Hi, is there a script for me to select the last 10 columns in my table (the ones after "Transition?") and add ".Cv" at the end of the original column name?

Column.PNG

 

I tried writing my script but it did not work:

 

dt = Current Data Table();

 

ColList = dt << get column names( string );

 

For( i = 11, i <= N Items( ColList ), i++, // set which column that look sat grade spec limits

 

NewName << ColList[i] || ".Cv";

Column( dt, ColList[i] ) << Set Name(NewName);

 

);

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How do I Script to Change Selected Column Names

Here is a simplified version of your code that will add ".Cv" to the end of the specified columns

dt = Current Data Table();
 
For( i = 11, i <= N Cols( dt ), i++, 
 
	Column( dt, i ) << Set Name( (Column( dt, i ) << Get Name) || ".Cv" );
 
);
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: How do I Script to Change Selected Column Names

Here is a simplified version of your code that will add ".Cv" to the end of the specified columns

dt = Current Data Table();
 
For( i = 11, i <= N Cols( dt ), i++, 
 
	Column( dt, i ) << Set Name( (Column( dt, i ) << Get Name) || ".Cv" );
 
);
Jim
ShahirahLoqman
Level II

Re: How do I Script to Change Selected Column Names

It works! Thank you so much !
wrubi
Level I

Re: How do I Script to Change Selected Column Names

somehow old but still good ;) ... thank you

Recommended Articles