如何通过脚本将查询到的数据表保存到指定文件夹?</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: 如何通过脚本将查询到的数据表保存到指定文件夹?我怀疑问题是您的文件路径和“数据 table.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" );