@海拉爾詢問在從不同資料夾匯入多個 CSV 檔案、更新值並使用不同名稱儲存 CSV如何做幾件事:從目錄樹中收集一堆 CSV 文件,進行編輯,然後將文件保存回其原始目錄,作為 CSV,稍微重命名。 本 JSL 將協助您入門。
刪除目錄時一定要小心! 不要在您的程式碼中使用它!
// JMP 15 or later required; JMP 14 does not have the recursive MFI option
dir = Convert File Path( "$temp/deletemeCSV/" ); // keep the paths in variables
// Delete Directory( dir ); // CAREFUL!!!!!
Create Directory( dir ); // making dummy data
subdira = Convert File Path( dir || "argyle/" ); // dummy sub dirs
subdirb = Convert File Path( dir || "plaid/" );
Create Directory( subdira );
Create Directory( subdirb );
dt = Open( "$sample_data/big class.jmp" ); // use this for dummy data
dt:name[1] = "katieA"; // make the dummy files distinct
dt << save( subdira || "a.csv" );
dt:name[1] = "katieB";
dt << save( subdirb || "b.csv" );
Close( dt, nosave ); // done with big class
dtlist = // MFI reurns a { list } of data tables, even if only one
Multiple File Import( // I removed a lot of default parameters
<<SET folder=""></SET>