JSL_open 並在 for 迴圈中連接清單中的資料表您好,我正在嘗試編寫腳本來在 JSL 中連接表,我們可以在其中輸入要連接的表的數量。為此,我創建了列表來輸入 html 表位置、表名稱和連接列。
在連接之前,我先打開表,在 for 迴圈中從列表中取得一個元素。
我收到錯誤訊息“訪問或評估“tables_list[i]”時出現下標問題,tables_list[/*###*/]。
知道我做錯了什麼嗎?預先感謝您的支持
// Indicate how many input data tables you have (default = 1)
nb_join_tables = 2;
// Indicate here the link to the first input HTML table
input_table_01 = "http://xxxx.html";
// Indicate here the names you want for your first JMP data tables
JMP_table_01_name = "xxx -01";
// Indicate here the link to the input HTML table to join
input_table_02 = "http://xxxx.html";
input_table_03 = "http://xxxx.html";
// Indicate here the names you want for the data tables to join
JMP_table_02_name = "xxx -02";
JMP_table_03_name = "xxx -03";<BR /><BR />// indicate here the column you want JMP to use as joiner for the tables merge (default:Parameter Set Name)<BR />joiner_table_01 = "Parameter Set Name";<BR />joiner_table_02 = "Parameter Set Name";<BR />joiner_table_03 = "Parameter Set Name";
// Create lists according to the number of tables to merge
tables_list = {input_table_01,input_table_02,input_table_03};
names_list= {JMP_table_01_name,JMP_table_02_name,JMP_table_03_name};
joiners_list = {joiner_table_01,joiner_table_02,joiner_table_03};
For( i = 0, i <= nb_join_tables, i++,
//Open html data table from specific location
dt=Open(
tables_list[i],
HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
);
// Set JMP data table name to the desired one
dt << Set Name( names_list[i] );
);自動化和腳本編寫資料存取品質和工藝工程回覆:JSL_open 並從 for 迴圈中的清單連接資料表太好了,謝謝,這有效!
回覆:JSL_open 並從 for 迴圈中的清單連接資料表這段程式碼
tables_list = {input_table_01,input_table_02,input_table_03};列出變數名稱,而不是變數內容列表。打開是在它期望內容的地方看到變數的名稱。您可以使用它來評估名稱及其內容:
tables_list = Eval List( {input_table_01,input_table_02,input_table_03} );或者您可以像這樣建立列表:
tables_list = {};
tables_list[1] = input_table_01;
tables_list[2] = input_table_02;
tables_list[3] = input_table_03;回覆:JSL_open 並從 for 迴圈中的清單連接資料表這是日誌:
我=1;
表格清單 = {input_table_01、input_table_02、input_table_03、input_table_04、input_table_05、input_table_06};
輸入表_01
Open 參數必須是存取或評估 'Open' 時的字串,Open/*###*/(tables_list[i], HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) ))
回覆:JSL_open 並從 for 迴圈中的清單連接資料表在失敗的地方之前加入調試語句:
For( i = 0, i <= nb_join_tables, i++,
show(i, tables_list); // check the log window for the output
//Open html data table from specific location
dt=Open(
tables_list[i],
HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
);
// Set JMP data table name to the desired one
dt << Set Name( names_list[i] );
);
回覆:JSL_open 並從 for 迴圈中的清單連接資料表你好克雷格,
我也嘗試過 n= 1,但它也不起作用。實際上,我已經將 i=1 設定為開始並測試了 i=0,以防萬一,並且在發布之前忘記再次設定 i=1。
但似乎不是問題。
還有其他想法嗎?
回覆:JSL_open 並從 for 迴圈中的清單連接資料表JSL 列表和矩陣從 1 開始。JMP 使用 for( i = 1, i <= n, i++, ... 而不是 for( i = 0, i < n, i++, .