<?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 Deleting Duplicate Scripts in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725044#M90901</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have concatenated multiple files into a database which has lead to a database with many duplicated scripts. Is there a way to write a script to remove duplicated scripts? I don't want to delete them manually as I will add more files to the database with concatenation in the future which would again add the scripts to the file.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 10:50:20 GMT</pubDate>
    <dc:creator>Katz0801</dc:creator>
    <dc:date>2024-02-22T10:50:20Z</dc:date>
    <item>
      <title>Deleting Duplicate Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725044#M90901</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have concatenated multiple files into a database which has lead to a database with many duplicated scripts. Is there a way to write a script to remove duplicated scripts? I don't want to delete them manually as I will add more files to the database with concatenation in the future which would again add the scripts to the file.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 10:50:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725044#M90901</guid>
      <dc:creator>Katz0801</dc:creator>
      <dc:date>2024-02-22T10:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Duplicate Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725047#M90903</link>
      <description>&lt;P&gt;You can use Get Table Script Names to get names of all table scripts. Then you can filter that down to a list of scripts you wish to remove and finally delete them with &amp;lt;&amp;lt; Delete Scripts&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
names = dt &amp;lt;&amp;lt; Get Table Script Names;
Show(names);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; New Table Script(
	"New Script",
	Distribution(Column(:Height, :Weight), By(:sex))
);
Wait(2);
dt &amp;lt;&amp;lt; Delete Scripts("New Script");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2024 11:01:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725047#M90903</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-02-22T11:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Duplicate Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725184#M90929</link>
      <description>&lt;P&gt;Update - I solved it using this method:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); 
names = dt &amp;lt;&amp;lt; Get Table Script Names;

Show(names);
wordsToDelete = {"Script 1 name", "Script 2 name", "Script 3 name"};
For(i = 1, i &amp;lt;= N Items(names), i++,
    scriptName = names[i];
    containsWord = 0;
    For(j = 1, j &amp;lt;= N Items(wordsToDelete), j++,
        word = wordsToDelete[j];
        If( Contains( scriptName, word ),
            containsWord = 1;
            Break();
        );
    );
   If( containsWord,
        dt &amp;lt;&amp;lt; Delete Scripts( scriptName );
    );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Feb 2024 10:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Duplicate-Scripts/m-p/725184#M90929</guid>
      <dc:creator>Katz0801</dc:creator>
      <dc:date>2024-02-23T10:55:07Z</dc:date>
    </item>
  </channel>
</rss>

