如何将运行程序()的文本输出到数据表中?我使用一个可执行文件,它从数据库中提取数据,进行一些数据操作,并将处理后的数据提供给最终用户。我想从 JMP 内部调用此可执行文件并将数据放入数据表中。以下脚本示例将数据生成为日志中的文本。如何将此文本放入数据表中,并将顶行作为列标题?
Names Default To Here (1);
Clear Log ();
rp = RunProgram(
Executable( "C:\dataFetchCmd\dataFetchCmd.exe" ),
//Options(),
ReadFunction("text");
);
自动化和脚本视窗回复:如何将运行程序()的文本输出到数据表中?取决于您从运行程序中得到的结果。有时使用 Open(Char To Blob(), "text") 可能就足够了,有时则不够(如下所示)
Names Default To Here(1);
RP = Run Program(
Executable("PING.EXE"/*path probably not needed*/ ),
Options({"-n 2", "localhost"}),
ReadFunction("text")
);
show(rp);
dt = Open(Char To Blob(RP), "text");
如果还不够的话,你可以在数据表中添加数据后对其进行修改,或者在将其构建到数据表之前对其进行修改
回复:如何将运行程序()的文本输出到数据表中?您可以使用日志捕获和文字来获取日志窗口输出并进行解析。
// OK we're good to go now.
batch interactive(1); // New 5-17-2018 force all errors to go to the log
log_contents = log capture(
// Put your commands that write to the log here ...
);
batch interactive(0); // New 5-17-2018 errors will not be forced to go to the log
// Parse the log window
crlf = hex to char("0D0A");
log_list = words(log_contents, crlf);