cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Scripting : Multiple tables from Excel

Writing a script to open  Excel files that contain multiple sheets then do independent analysis with each individual sheet. The names and number of sheets from different Excel files can be different, so would like to write a generic code that can work on different files.

 

Used Open command to open the file

dt = Open ("file path");

 

This particular example file has three sheets, so show (dt); gives this result in log:

dt = {DataTable("Sheet 1"), DataTable("Sheet 2"), DataTable("Sheet 3")}

;

Need to assign each datatable in dt to different variables, what is the correct syntax to do that?

 

I tried:

dt1 = dt (1);


It did not work. dt1 essentially equals dt. show (dt1); gives this result in log:

dt1 = {DataTable("Sheet 1"), DataTable("Sheet 2"), DataTable("Sheet 3")};

 

Thanks!

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Scripting : Multiple tables from Excel

dt seems to be a list, so reference items by using indices

dt[1]

if you have JMP16 For Each might also be helpful

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Scripting : Multiple tables from Excel

dt seems to be a list, so reference items by using indices

dt[1]

if you have JMP16 For Each might also be helpful

-Jarmo

Recommended Articles