<?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: Wildcard selection of characters from a given file name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41228#M24051</link>
    <description>&lt;P&gt;txnelson: Thank you for prompt response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for some reason it still returns all files with "123" and doesn't consider "XY" as a search criteria.&lt;/P&gt;&lt;P&gt;Does it have to do anything with multiple delims?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 00:17:12 GMT</pubDate>
    <dc:creator>CG</dc:creator>
    <dc:date>2017-06-27T00:17:12Z</dc:date>
    <item>
      <title>Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41225#M24048</link>
      <description>&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Hello,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;I am trying to look up certain characters from a file name and&amp;nbsp;select&amp;nbsp;those file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;for eg: file name: HELLO123_MT_XYZ, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Code:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;For&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; i &lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;=&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Consolas" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; i &lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;&amp;lt;=&lt;/FONT&gt; &lt;FONT color="#0000dd" face="Consolas" size="2"&gt;N Items&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; i&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;++,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;If&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Contains&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#800080" face="Consolas" size="2"&gt;"MT"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#008000" face="Consolas" size="2"&gt;//Enter search criteria from file name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Open&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;Above code with &lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;"MT" will pull all file names with MT as character. But how can i select files with wild card? for eg: *123*XY*&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 22:25:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41225#M24048</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2017-06-26T22:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41227#M24050</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Contains( files[i], "123" ) &amp;gt; 0 &amp;amp; Contains( files[i], "XY" ) &amp;gt; Contains( files[i], "123" ),
	Open( files[i] )
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jun 2017 23:47:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41227#M24050</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-26T23:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41228#M24051</link>
      <description>&lt;P&gt;txnelson: Thank you for prompt response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for some reason it still returns all files with "123" and doesn't consider "XY" as a search criteria.&lt;/P&gt;&lt;P&gt;Does it have to do anything with multiple delims?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 00:17:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41228#M24051</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2017-06-27T00:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41229#M24052</link>
      <description>&lt;P&gt;oops, my error, it should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Contains( files[i], "123" ) &amp;gt; 0 &amp;amp; Contains( files[i], "123" ) &amp;gt; 0 &amp;amp; Contains( files[i], "XY" ) &amp;gt; Contains( files[i], "123" ),
	Open( files[i] )
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2017 00:58:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41229#M24052</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-27T00:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41230#M24053</link>
      <description>&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Actually if i use below - &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;If&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Contains&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#800080" face="Consolas" size="2"&gt;"123"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;&amp;gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Consolas" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#000080" face="Consolas" size="2"&gt;&amp;amp;&lt;/FONT&gt; &lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Contains&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#800080" face="Consolas" size="2"&gt;"XY"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;&amp;gt;&lt;/FONT&gt; &lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Contains&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Consolas" size="2"&gt; files&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt; &lt;FONT color="#800080" face="Consolas" size="2"&gt;"123"&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080" face="Consolas" size="2"&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;I can get result. but o&lt;/FONT&gt;ne issue i found is, if file name&amp;nbsp;are -&lt;/P&gt;&lt;P&gt;1. HELLOABC_0A_H2ABC&lt;/P&gt;&lt;P&gt;2. HELLOABC_1D_H2ABC&lt;/P&gt;&lt;P&gt;If i select "ABC" and "0A", then i get all files with "ABC" whereas if i use "ABC" and "1D" then i get specific file which contains both characters in the file name.&lt;/P&gt;&lt;P&gt;How does it get differentiate between &lt;STRONG&gt;0&lt;/STRONG&gt;A vs &lt;STRONG&gt;1&lt;/STRONG&gt;D? They both should be treated as string.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 05:23:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41230#M24053</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2017-06-27T05:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41231#M24054</link>
      <description>&lt;P&gt;sorry for multiple posts.&lt;/P&gt;&lt;P&gt;But if i use second criteria as "&lt;STRONG&gt;_&lt;/STRONG&gt;0A" then i can get specific file instead when i use "0A" then it ignore this criteria.&lt;/P&gt;&lt;P&gt;I am sure i am missing something very basic condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chintan&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 05:31:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41231#M24054</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2017-06-27T05:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41243#M24065</link>
      <description>&lt;P&gt;I am confused with your entries. &amp;nbsp;First, lets clear up the code issue. &amp;nbsp;I initially made an error in the code. &amp;nbsp;And then I messed up again. The code you need to be using is:&lt;/P&gt;
&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"123"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"XY"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"XY"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Contains&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"123"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is nothing magical about this code. &amp;nbsp;Let me explain it. &amp;nbsp;The Contains() function looks across a literal string, in your case, the current value of Files[i], looking for the value of the second argument "123". &amp;nbsp;If found it returns the position it was found in. So the first use of the Contains() makes sure that there is the value "123". &amp;nbsp;The second use makes sure there is a value of "XY" and the thrid comparison makes sure that "XY" is found after the value of "123". &amp;nbsp;That is all it is doing.&lt;/P&gt;
&lt;P&gt;I apologize for the coding error.....&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 12:07:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41243#M24065</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-27T12:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41259#M24075</link>
      <description>&lt;P&gt;Regular expressions can provide a more general solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Wildcard in a string: *123*XY*

slist = {"HELLO123_MT_XYZ", "HELLO123_MT_Z", "GOODBYE123_MT_XY", "XY_FUBAR_123"};

rx = "(123).*(XY)";

for (i = 1, i &amp;lt;= nitems(slist), i++,
	result = regex(slist[i], rx);
	print(slist[i] || ": " || char(result));

);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:35:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41259#M24075</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-06-27T13:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Wildcard selection of characters from a given file name</title>
      <link>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41272#M24082</link>
      <description>&lt;P&gt;Thank you for responses.&lt;/P&gt;&lt;P&gt;I didn't notice i had same character repeating twice in file name and hence it was pulling whole bunch of file.&lt;/P&gt;&lt;P&gt;I limited string length of file name and now i can get files based on search criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much guys!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 18:19:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Wildcard-selection-of-characters-from-a-given-file-name/m-p/41272#M24082</guid>
      <dc:creator>CG</dc:creator>
      <dc:date>2017-06-27T18:19:41Z</dc:date>
    </item>
  </channel>
</rss>

