根据实验条件,我在不同文件夹下有两种不同格式的 Excel 文件的实验结果。 有没有办法让用户指定父目录,然后 JMP 将所有 Excel 文件作为数据表打开?
我还需要能够根据文件的格式来声明数据开始的行,以便列名正确。
我尝试过使用工作流程,但无法将其用于超过 1 个文件,并且我尝试过导入多个文件功能,但这仅允许访问 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" )
);