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.
%3CLINGO-SUB%20id%3D%22lingo-sub-688618%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E7%95%B0%E3%81%AA%E3%82%8B%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC%E3%81%AB%E3%81%82%E3%82%8B%E8%A4%87%E6%95%B0%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E9%96%8B%E3%81%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-688618%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%AE%9F%E9%A8%93%E3%81%AE%E6%9D%A1%E4%BB%B6%E3%81%AB%E5%BF%9C%E3%81%98%E3%81%A6%E3%80%81%E5%AE%9F%E9%A8%93%E7%B5%90%E6%9E%9C%E3%82%92%202%20%E3%81%A4%E3%81%AE%E7%95%B0%E3%81%AA%E3%82%8B%E5%BD%A2%E5%BC%8F%E3%81%AE%20Excel%20%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A8%E3%81%97%E3%81%A6%E7%95%B0%E3%81%AA%E3%82%8B%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC%E3%81%AB%E4%BF%9D%E5%AD%98%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%20%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%8C%E8%A6%AA%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%82%92%E6%8C%87%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81JMP%20%E3%81%8C%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%20Excel%20%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E3%83%87%E3%83%BC%E3%82%BF%20%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%81%A8%E3%81%97%E3%81%A6%E9%96%8B%E3%81%8F%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FP%3E%3CP%3E%E3%81%BE%E3%81%9F%E3%80%81%E5%88%97%E5%90%8D%E3%81%8C%E6%AD%A3%E3%81%97%E3%81%8F%E3%81%AA%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%80%81%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%BD%A2%E5%BC%8F%E3%81%AB%E5%BF%9C%E3%81%98%E3%81%A6%E3%83%87%E3%83%BC%E3%82%BF%E3%81%8C%E9%96%8B%E5%A7%8B%E3%81%99%E3%82%8B%E8%A1%8C%E3%82%92%E6%8C%87%E5%AE%9A%E3%81%A7%E3%81%8D%E3%82%8B%E5%BF%85%E8%A6%81%E3%82%82%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%95%E3%83%AD%E3%83%BC%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%BF%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E8%A4%87%E6%95%B0%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E4%BD%BF%E7%94%A8%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%81%BE%E3%81%9F%E3%80%81%E8%A4%87%E6%95%B0%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E6%A9%9F%E8%83%BD%E3%82%92%E8%A9%A6%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%81%A7%E3%81%8D%E3%82%8B%E3%81%AE%E3%81%AF%201%20%E3%81%A4%E3%81%AE%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC%E3%81%AE%E3%81%BF%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-688618%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%A8%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E4%BD%9C%E6%88%90%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%84%E3%81%AE%E6%A7%8B%E6%88%90%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E3%83%87%E3%83%BC%E3%82%BF%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E3%83%96%E3%83%AC%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E3%81%A8%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%A2%E3%83%83%E3%83%97%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E3%83%9E%E3%82%B9%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-688649%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E8%A4%87%E6%95%B0%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E5%88%A5%E3%81%AE%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%BC%E3%81%A7%E9%96%8B%E3%81%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-688649%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E3%81%82%E3%81%AA%E3%81%9F%E3%81%8C%E6%9C%9B%E3%82%80%E3%81%93%E3%81%A8%E3%82%92%E8%A1%8C%E3%81%86%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AB%E3%82%88%E3%82%8A%E3%80%81%E5%A0%85%E7%89%A2%E3%81%AA%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%AE%E9%96%8B%E7%99%BA%E3%82%92%E5%A7%8B%E3%82%81%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0A%2F%2F%20Find%20the%20top%20directory%20to%20get%20the%20xlsx%20files%20from%0Apath%20%3D%20Pick%20Directory()%3B%0A%0A%2F%2F%20Read%20in%20all%20of%20the%20file%20names%0AallFiles%20%3D%20Files%20In%20Directory(%20path%2C%20recursive(%201%20)%20)%3B%0A%0A%2F%2F%20Create%20a%20list%20of%20just%20the%20xlsx%20files%0AxlsxFiles%20%3D%20%7B%7D%3B%0AFor%20Each(%20%7Bfile%7D%2C%20allFiles%2C%0A%20If(%20Word(%20-1%2C%20file%2C%20%22.%22%20)%20%3D%3D%20%22xlsx%22%2C%0A%20%20Insert%20Into(%20xlsxFiles%2C%20file%20)%0A%20)%0A)%3B%0A%0A%2F%2F%20Open%20each%20of%20the%20xlsx%20files%20one%20after%20another%0A%2F%2F%20using%20the%20Excel%20Wizard%0AFor%20Each(%20%7Bfile%2C%20i%7D%2C%20xlsxFiles%2C%0A%20Open(%20path%20%7C%7C%20xlsxFiles%5Bi%5D%2C%20%22excel%20wizard%22%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

Open Multiple files in different folders

I have experimental results in 2 different formats as excel files under different folders depending on the conditions of the experiment. Is there a way for the user to state the parent directory and then JMP will open all the excel files as data tables?

I also need need to be able to state the row the data starts on depending on which format the file is so that the column names are correct.

 

I have tried using workflow but I'm not able to use it for more than 1 file and I have tried the importing multiple files function but this only allows access in to 1 folder.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Open Multiple files in different folders

Here is a beginning script that does what you want.  It should give you a good start on developing a robust script.

Names Default To Here( 1 );

// Find the top directory to get the xlsx files from
path = Pick Directory();

// Read in all of the file names
allFiles = Files In Directory( path, recursive( 1 ) );

// Create a list of just the xlsx files
xlsxFiles = {};
For Each( {file}, allFiles,
	If( Word( -1, file, "." ) == "xlsx",
		Insert Into( xlsxFiles, file )
	)
);

// Open each of the xlsx files one after another
// using the Excel Wizard
For Each( {file, i}, xlsxFiles,
	Open( path || xlsxFiles[i], "excel wizard" )
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Open Multiple files in different folders

Here is a beginning script that does what you want.  It should give you a good start on developing a robust script.

Names Default To Here( 1 );

// Find the top directory to get the xlsx files from
path = Pick Directory();

// Read in all of the file names
allFiles = Files In Directory( path, recursive( 1 ) );

// Create a list of just the xlsx files
xlsxFiles = {};
For Each( {file}, allFiles,
	If( Word( -1, file, "." ) == "xlsx",
		Insert Into( xlsxFiles, file )
	)
);

// Open each of the xlsx files one after another
// using the Excel Wizard
For Each( {file, i}, xlsxFiles,
	Open( path || xlsxFiles[i], "excel wizard" )
);
Jim

Recommended Articles