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++, .