<?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: How to check if list value exist in folder? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/521144#M74652</link>
    <description>&lt;P&gt;How can I transform this into an array?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fileNames = Files In Directory( directory );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Jul 2022 02:37:53 GMT</pubDate>
    <dc:creator>UserID16644</dc:creator>
    <dc:date>2022-07-14T02:37:53Z</dc:date>
    <item>
      <title>How to check if list value exist in folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/520587#M74625</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have files that needs to be checked if it is existing in a folder. If it does not exist, a prompt will show which file names are not in my list. Here's a snippet of my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Sample Data
dt = Open( "$SAMPLE_DATA/Quality Control/Diameter.jmp" );
New Column ("Machine Op", Character,
&amp;nbsp;&amp;nbsp; &amp;nbsp;Formula
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;( "Machine_" || :MACHINE || " Op_" || :OPERATOR )&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;);
dt_list =associative array(column(dt, "Machine Op" ) &amp;lt;&amp;lt;get values) &amp;lt;&amp;lt;get keys;

//Files in folder
directory = "C:\Users\Desktop\Machine Operator Reference";
fileNames = Files In Directory( directory );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*&amp;nbsp;if&amp;nbsp;dt_list&amp;nbsp;does not exist in&amp;nbsp;fileNames,&amp;nbsp;prompt&amp;nbsp;data&amp;nbsp;table&amp;nbsp;with&amp;nbsp;missing file&amp;nbsp;*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:50:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/520587#M74625</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T23:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if list value exist in folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/520608#M74626</link>
      <description>&lt;P&gt;Check set operations for associative arrays &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/associative-arrays-in-set-operations.shtml#" target="_blank" rel="noopener"&gt; Scripting Guide &amp;gt; Data Structures &amp;gt; Associative Arrays &amp;gt; Associative Arrays in Set Operations&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1657701261181.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43899i574D36ABFE3EDD0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1657701261181.png" alt="jthi_0-1657701261181.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:34:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/520608#M74626</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-13T08:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if list value exist in folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/521144#M74652</link>
      <description>&lt;P&gt;How can I transform this into an array?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fileNames = Files In Directory( directory );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jul 2022 02:37:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/521144#M74652</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2022-07-14T02:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if list value exist in folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/521166#M74654</link>
      <description>&lt;P&gt;The variable fileNames, is a JMP List, which is similar to an array.&amp;nbsp; Elements within the list, can be referenced by subscript;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fileNames[3] returns the 3rd file name from the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are asking, how do you move this into an Associative Array&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_list=associative array(filenames)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jul 2022 05:07:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-check-if-list-value-exist-in-folder/m-p/521166#M74654</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-14T05:07:56Z</dc:date>
    </item>
  </channel>
</rss>

