実験の条件に応じて、実験結果を 2 つの異なる形式の Excel ファイルとして異なるフォルダーに保存しています。 ユーザーが親ディレクトリを指定すると、JMP がすべての Excel ファイルをデータ テーブルとして開く方法はありますか?
また、列名が正しくなるように、ファイルの形式に応じてデータが開始する行を指定できる必要もあります。
ワークフローを使用してみましたが、複数のファイルに使用できません。また、複数ファイルのインポート機能を試しましたが、アクセスできるのは 1 つのフォルダーのみです。
これは、あなたが望むことを行う最初のスクリプトです。これにより、堅牢なスクリプトの開発を始めることができます。
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" )
);