<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL_open and join data tables from a list in a for loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409996#M65979</link>
    <description>&lt;P&gt;this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = {input_table_01,input_table_02,input_table_03};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;makes a list of names of variables, not a list of the content of the variables. Open is seeing the name of the variable where it expects the content. You can use this to evaluate the names to their content:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = Eval List( {input_table_01,input_table_02,input_table_03} );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or you can build the list like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = {};
tables_list[1] = input_table_01;
tables_list[2] = input_table_02;
tables_list[3] = input_table_03;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 Aug 2021 12:10:56 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-08-16T12:10:56Z</dc:date>
    <item>
      <title>JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409944#M65970</link>
      <description>&lt;P&gt;Hello, I am trying to write a script to join tables in JSL, where we can input the number of tables to join. For this, I created lists to input html table location, tables names and joiner columns.&lt;/P&gt;&lt;P&gt;Before the join, I start by opening the tables, taking an element from the lists in a for loop.&lt;/P&gt;&lt;P&gt;I get an error message "Subscript problem in access or evaluation&amp;nbsp; of "tables_list[i]", tables_list[/*###*/].&lt;/P&gt;&lt;P&gt;Any idea what I did wrong? Thank you in advance for the support&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// 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";&lt;BR /&gt;&lt;BR /&gt;// indicate here the column you want JMP to use as joiner for the tables merge (default:Parameter Set Name)&lt;BR /&gt;joiner_table_01 = "Parameter Set Name";&lt;BR /&gt;joiner_table_02 = "Parameter Set Name";&lt;BR /&gt;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 &amp;lt;= 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 &amp;lt;&amp;lt; Set Name( names_list[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:54:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409944#M65970</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2023-06-09T19:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409966#M65972</link>
      <description>&lt;P&gt;JSL lists and matrices start at 1. JMP uses for( i = 1, i &amp;lt;= n, i++, ... rather than for( i = 0, i &amp;lt; n, i++, .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 09:50:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409966#M65972</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-08-16T09:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409983#M65975</link>
      <description>&lt;P&gt;Hello Craige,&lt;/P&gt;&lt;P&gt;I tried also with n= 1 and it does not work neither. Actually, I've put i=1 to start with and tested to i=0 just in case and forgot to put i=1 again before posting.&lt;/P&gt;&lt;P&gt;Does not seem to be the issue though.&lt;/P&gt;&lt;P&gt;Any other idea?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 11:14:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409983#M65975</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-16T11:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409986#M65976</link>
      <description>&lt;P&gt;add a debugging statement just before the place it fails:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 0, i &amp;lt;= 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 &amp;lt;&amp;lt; Set Name( names_list[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Aug 2021 11:29:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409986#M65976</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-08-16T11:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409987#M65977</link>
      <description>&lt;P&gt;Here is the log :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i = 1;&lt;BR /&gt;tables_list = {input_table_01, input_table_02, input_table_03, input_table_04, input_table_05, input_table_06};&lt;BR /&gt;input_table_01&lt;BR /&gt;Open argument must be string in access or evaluation of 'Open' , Open/*###*/(tables_list[i], HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) ))&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 11:36:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409987#M65977</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-16T11:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409996#M65979</link>
      <description>&lt;P&gt;this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = {input_table_01,input_table_02,input_table_03};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;makes a list of names of variables, not a list of the content of the variables. Open is seeing the name of the variable where it expects the content. You can use this to evaluate the names to their content:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = Eval List( {input_table_01,input_table_02,input_table_03} );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or you can build the list like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tables_list = {};
tables_list[1] = input_table_01;
tables_list[2] = input_table_02;
tables_list[3] = input_table_03;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Aug 2021 12:10:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/409996#M65979</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-08-16T12:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: JSL_open and join data tables from a list in a for loop</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/410132#M65990</link>
      <description>&lt;P&gt;Great, thank you, that works!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 15:08:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-open-and-join-data-tables-from-a-list-in-a-for-loop/m-p/410132#M65990</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-16T15:08:36Z</dc:date>
    </item>
  </channel>
</rss>

