如何通過腳本將查詢到的數據表保存到指定文件夾?</CODE></PRE><P>你好! 這裡有誰知道如何通過jmp腳本將查詢到的數據表保存到指定文件夾嗎? 似乎找不到正確的方法...... 提前致謝!</P><P>這是我的示例腳本:</P><PRE><CODE class=" language-jsl">Data Table( "name of data table" );
//save raw data table to a folder
dt = current data table ();
filepath = "C:\Users\folder path";
dt<< save(filepath || "name of data table.jmp");
內容組織數據混合和清理Re: 如何通過腳本將查詢到的數據表保存到指定文件夾?是的。 大多數時候,在路徑上保留尾部斜杠似乎效果更好:
path = "$temp/mywork/";
大多數(所有?)只需要路徑而不需要文件的函數都對此感到滿意:
path = "$temp/mywork/";
show(convertFilePath(path,"windows"));
轉換文件路徑(path, "windows") = "C:\Users\v1\AppData\Local\Temp\mywork\";
對於後來查看代碼的人來說,它顯然不是完整的文件名。
Re: 如何通過腳本將查詢到的數據表保存到指定文件夾?我懷疑問題在於您的文件路徑和“數據表名稱.jmp”之間缺少“/”。下面是一個工作腳本
Names Default To Here( 1 );
Open( "$SAMPLE_DATA\big class.jmp" );
dt = Data Table( "big class" );
filepath = "$TEMP";
Wait( 5 ); // placed for the example so the table will be visible
dt << save( filepath || "\" || "mytable.jmp" );
Close( dt, nosave );
Wait( 5 ); // placed so for the example one can see the table is closed
Open( filepath || "\" || "mytable.jmp" );