cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

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

How to set object name based on table name?

I have several data tables with different names. I want to open the data tables and set the object name to be the same as the file name. 

 

Here's an idea of it. The end goal is to have an object called "Animals" that points to "Animals.jmp".

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp" );
Create Object (char(dt)) << dt;
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to set object name based on table name?

Here is a simple script that does creates the variables for each of the data tables open in the JMP session

Names Default To Here( 1 );
For( i = 1, i <= N Table(), i++,

theName = data table(i) << get name; 

	Eval(
		Substitute(
				Expr(
					__name__ = Data Table( i )
				),
			Expr( __name__ ), Parse(theName)
		)
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: How to set object name based on table name?

Here is a simple script that does creates the variables for each of the data tables open in the JMP session

Names Default To Here( 1 );
For( i = 1, i <= N Table(), i++,

theName = data table(i) << get name; 

	Eval(
		Substitute(
				Expr(
					__name__ = Data Table( i )
				),
			Expr( __name__ ), Parse(theName)
		)
	)
);
Jim

Recommended Articles