<?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: Delete multiple table opened with certain string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419579#M66854</link>
    <description>&lt;P&gt;I would suggest closing the data tables immediately after they are not needed with Close(datatablereference, No Save), but it will require most likely a bit more scripting to add those to correct locations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is a script to which should close all datatables starting with subset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

tableList = Get Data Table List(); //get names of all tables

for(i = 1, i &amp;lt;= N Items(tableList), i++,
	//get name of current table in list
	currentTableName = tableList[i] &amp;lt;&amp;lt; Get Name; 
	//check if table starts with subset. Use Lowercase() to take care of different way of naming "subset"
	isSubsetTable = Starts With(Lowercase(currentTableName), "subset"); 
	If(isSubsetTable,
		Try(
			Close(tableList[i], no save);
			Print("Closed data table: " || currentTableName ||"."),
			show(exception_msg)); //try to close
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Sep 2021 12:09:33 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-09-21T12:09:33Z</dc:date>
    <item>
      <title>Delete multiple table opened with certain string</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419566#M66853</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm really bad with coding. I have a script where it opens multiple subset of tables, appends it and creates a control chart. The problem is that multiple subtables are created and left opened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All table name starts with the string "subset". How can I close all tables at once?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:57:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419566#M66853</guid>
      <dc:creator>ninanoc</dc:creator>
      <dc:date>2023-06-09T19:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete multiple table opened with certain string</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419579#M66854</link>
      <description>&lt;P&gt;I would suggest closing the data tables immediately after they are not needed with Close(datatablereference, No Save), but it will require most likely a bit more scripting to add those to correct locations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is a script to which should close all datatables starting with subset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

tableList = Get Data Table List(); //get names of all tables

for(i = 1, i &amp;lt;= N Items(tableList), i++,
	//get name of current table in list
	currentTableName = tableList[i] &amp;lt;&amp;lt; Get Name; 
	//check if table starts with subset. Use Lowercase() to take care of different way of naming "subset"
	isSubsetTable = Starts With(Lowercase(currentTableName), "subset"); 
	If(isSubsetTable,
		Try(
			Close(tableList[i], no save);
			Print("Closed data table: " || currentTableName ||"."),
			show(exception_msg)); //try to close
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Sep 2021 12:09:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419579#M66854</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-21T12:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete multiple table opened with certain string</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419583#M66855</link>
      <description>&lt;P&gt;Here is a simple piece of code that will delete the subsets&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
numTables = N Table();
For( t = numTables, t &amp;gt;= 1, t--,
	tName = Data Table( t ) &amp;lt;&amp;lt; get name;
	Show( t, tname );
	If( Left( tName, 6 ) == "Subset",
		Close( Data Table( tName ), nosave )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Sep 2021 12:25:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-multiple-table-opened-with-certain-string/m-p/419583#M66855</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-21T12:25:43Z</dc:date>
    </item>
  </channel>
</rss>

