如何將Run Program()的文字輸出取得到資料表中?我使用一個可執行文件,它從資料庫中提取數據,進行一些數據操作並將操作後的數據提供給最終用戶。我想從 JMP 中調用此可執行檔並將資料放入資料表中。以下腳本範例在日誌中產生文字形式的資料。如何將此文字放入資料表中,並將頂行作為列標題?
Names Default To Here (1);
Clear Log ();
rp = RunProgram(
Executable( "C:\dataFetchCmd\dataFetchCmd.exe" ),
//Options(),
ReadFunction("text");
);
自動化和腳本編寫視窗回覆:如何將 Run Program() 的文字輸出取得到資料表中?取決於你從運行程式中得到什麼。有時使用 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");
如果還不夠,您可以在將資料放入資料表之後或將其建置到資料表之前修改數據
回覆:如何將 Run Program() 的文字輸出取得到資料表中?您可以使用日誌擷取和單字來取得日誌視窗輸出並對其進行解析。
// 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);