cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
AFaiz
Level II

import Multiple excel files with many tabs into one table in JMP

Hi, I am using "import Multiple files" feature to get data from different excel files, my challenge is that only data from the first tab are extracted. I have three more tabs on each file that I would like to get the data from. Is there a way to do that in JMP? appreciate all the help.

AFaiz

15 REPLIES 15
AFaiz
Level II

Re: import Multiple excel files with many tabs into one table in JMP

The problem is that the column with file name and tab name does not get created. there is a File Name column that contains the source file name followed by the data. The source table is incorrect, the same naming is used for data from multiple files/tabs. 

 

AFaiz_0-1718215158238.png

 

txnelson
Super User

Re: import Multiple excel files with many tabs into one table in JMP

Please provide the following information from this information from 1 of your imported Excel workbooks

  1. The path directory folder
  2. The file name of the workbook
  3. The names of the Tabs(spreadsheets) in the Excel workbook
  4. The data table names that JMP gave the different data tables after running MFI on the workbook
  5. The values in the column File Name for the data tables created
Jim
AFaiz
Level II

Re: import Multiple excel files with many tabs into one table in JMP

I have attached the script, 2x excel files with multi tabs, and generated table when the script is run.

Thanks for your help,

Faiz

txnelson
Super User

Re: import Multiple excel files with many tabs into one table in JMP

The documentation does not state it, but apparently the default setting for Stack Mode is Stack Similar.  When I force it to Table Per File it seems to fix the issues

theFiles = Multiple File Import(
	<<set folder( "C:\Users\abderrazzakf\OneDrive - Samtec\Desktop\Script testing\" )
) << Set Add File Name Column( 1 )<< Set Stack Mode( "Table Per File" )<< import data;
Jim
AFaiz
Level II

Re: import Multiple excel files with many tabs into one table in JMP

This is working great, now the "Source Table" column lists the file and tab names correctly. Really appreciate all the help.

One last question, not really crucial, is there a way to exclude the data from one of the tabs? I don't really want data from the "Main" tab as it is only listing date and time. Now that I have everything in the same table, I can do some manual cleanup, just wondering if there is a way to add that to the script.

Thanks again,

Faiz

txnelson
Super User

Re: import Multiple excel files with many tabs into one table in JMP

There are a few ways to do this.

  1. Use a Contains() function to search theFiles list and then use Remove From() function to delete the table from the list, which will remove it from the Concatenate operation.
  2. After the Together data table is created, use the Select Where() function to identify the rows in the data table from the Source Table column that you do not want, and then use Delete Rows to delete the selected rows.
Jim