<?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 do I get the file names with a specific suffix from a folder? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448465#M69536</link>
    <description>&lt;P&gt;You could try using Multiple File Import found from File / Import Multiple Files...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1640934626650.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38687i00409402E661F80F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1640934626650.png" alt="jthi_0-1640934626650.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or loop over the list you have while filtering out non-wanted results.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

fileNames = {"test0.s2p", "test.jmp", "test1.jsl", "test2.s2p"};
suffix_of_interest = ".s2p";

//JMP16
files_of_interest = Filter Each({val}, fileNames, Ends With(val, suffix_of_interest));
show(files_of_interest);

//earlier
files_of_interest2 = {};
For(i = 1, i &amp;lt;= N Items(fileNames), i++,
	val = fileNames[i];
	If(Ends With(val, suffix_of_interest),
		Insert Into(files_of_interest2, val);
	);
);
show(files_of_interest2);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Dec 2021 07:10:45 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-12-31T07:10:45Z</dc:date>
    <item>
      <title>How do I get the file names with a specific suffix from a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448440#M69532</link>
      <description>&lt;P&gt;I am trying to import some data from a folder, it contains different type of files, and I just want the file with *.s2p suffix, how can I&amp;nbsp; get all the filename with&amp;nbsp; .s2p&amp;nbsp; suffix?&amp;nbsp; I use files in directory function, but it can only get all the filename.&lt;/P&gt;&lt;PRE&gt;fileNames = Files In Directory( directory );    &lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:08:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448440#M69532</guid>
      <dc:creator>Jiaxiang</dc:creator>
      <dc:date>2023-06-09T18:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the file names with a specific suffix from a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448465#M69536</link>
      <description>&lt;P&gt;You could try using Multiple File Import found from File / Import Multiple Files...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1640934626650.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38687i00409402E661F80F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1640934626650.png" alt="jthi_0-1640934626650.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or loop over the list you have while filtering out non-wanted results.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

fileNames = {"test0.s2p", "test.jmp", "test1.jsl", "test2.s2p"};
suffix_of_interest = ".s2p";

//JMP16
files_of_interest = Filter Each({val}, fileNames, Ends With(val, suffix_of_interest));
show(files_of_interest);

//earlier
files_of_interest2 = {};
For(i = 1, i &amp;lt;= N Items(fileNames), i++,
	val = fileNames[i];
	If(Ends With(val, suffix_of_interest),
		Insert Into(files_of_interest2, val);
	);
);
show(files_of_interest2);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 07:10:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448465#M69536</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-12-31T07:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the file names with a specific suffix from a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448468#M69537</link>
      <description>&lt;P&gt;Nice! Now I need to go read about Filter Each:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Filter Each for JMP 16 in Help-&amp;gt;Scripting Index" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38689i3086EB41D22F1E98/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Filter Each for JMP 16 in Help-&amp;gt;Scripting Index" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Filter Each for JMP 16 in Help-&amp;gt;Scripting Index&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The scripting index has three examples; the Associative Array example is in the picture. I like&amp;nbsp; &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; example because it hints that the expression for selecting items can be more complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 11:07:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-get-the-file-names-with-a-specific-suffix-from-a-folder/m-p/448468#M69537</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-12-31T11:07:37Z</dc:date>
    </item>
  </channel>
</rss>

