<?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 open folder with unique identifier in name but variable ending? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48642#M27666</link>
    <description>&lt;P&gt;Thanks a lot. I see now how I get the name but how ca nI get the path of the folder?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2017 17:19:01 GMT</pubDate>
    <dc:creator>SC1</dc:creator>
    <dc:date>2017-12-14T17:19:01Z</dc:date>
    <item>
      <title>How do I open folder with unique identifier in name but variable ending?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48626#M27656</link>
      <description>&lt;P&gt;I am trying to write a script to&amp;nbsp;open a&amp;nbsp;folder where the name of the&amp;nbsp;folder contains halfway in the name a unique identifier.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;folder is a subfolder of a folder which is&amp;nbsp;defined by the user together with the unique identifier in a dialog box.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;::result = Dialog&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;v list&lt;STRONG&gt;(&lt;/STRONG&gt; "Year 20XX", year=Edit Text&lt;STRONG&gt;(&lt;/STRONG&gt;"17",width&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;STRONG&gt;)))&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;v list&lt;STRONG&gt;(&lt;/STRONG&gt; "Identifier", iden=Edit Text&lt;STRONG&gt;(&lt;/STRONG&gt;"AA1211",width&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;STRONG&gt;)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;The name of&amp;nbsp;all subfolder have the same structure ABC-year-iden-xxxx bbb ddddd FFF.&lt;/P&gt;&lt;P&gt;ABC is fixed. year and iden are selected by the user but x b d F are variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;tried to get the filename with pick file but it does not work as last bit of it is variable.&lt;/P&gt;&lt;P&gt;Foldername = Pick file&lt;STRONG&gt;(&lt;/STRONG&gt;"\\Select&amp;nbsp;folder","C:\Users\20"||::result&lt;STRONG&gt;[&lt;/STRONG&gt;"year"&lt;STRONG&gt;]&lt;/STRONG&gt;||"\"||"ABC-"||::result&lt;STRONG&gt;[&lt;/STRONG&gt;"year"&lt;STRONG&gt;]&lt;/STRONG&gt;||"-"||::result&lt;STRONG&gt;[&lt;/STRONG&gt;"iden"&lt;STRONG&gt;]&lt;/STRONG&gt;||"-*"&lt;STRONG&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option is reading the names of the subfolders in the main folder and try to match it but I cannot figure it out with regex.&lt;/P&gt;&lt;P&gt;files = Files In Directory&lt;STRONG&gt;(&lt;/STRONG&gt;"C:\Users\20"||::result&lt;STRONG&gt;[&lt;/STRONG&gt;"year"&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;The idea is once I have this folderpathname open a file in this folder with the same name as the subfolder. For that I have the script but I just am looking for a way to identify the subfolder pathway and filename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SC&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:58:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48626#M27656</guid>
      <dc:creator>SC1</dc:creator>
      <dc:date>2017-12-14T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I open folder with unique identifier in name but variable ending?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48630#M27659</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10500"&gt;@SC1&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;RootFolder = "C:\";  // Please fill in your desired folder location 

FileList = Files In Directory(RootFolder); // Extract list of all files

DesList = list(); // Declare empty list 

UserInput = 2005 ; 

for(i = 1, i &amp;lt;= N Items(FileList), i++,
		If(!IsMissing(Regex(Char(FileList[i]),Concat(Char(UserInput),"-","ABC|FFF")),
			Insert Into(DesList,FileList[i]); 
		  );
   );
// This will be able to capture all files which are of the format  2005-ABC or 2005-FFF . You can expand on the or clause based on your need &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 15:27:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48630#M27659</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-12-14T15:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I open folder with unique identifier in name but variable ending?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48642#M27666</link>
      <description>&lt;P&gt;Thanks a lot. I see now how I get the name but how ca nI get the path of the folder?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:19:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48642#M27666</guid>
      <dc:creator>SC1</dc:creator>
      <dc:date>2017-12-14T17:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I open folder with unique identifier in name but variable ending?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48643#M27667</link>
      <description>&lt;P&gt;&amp;nbsp;Maybe use Pick Directory() or you can declare it ahead and use the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;RootFolder = "C:/" ;   // or Pick Directory() 
Year = 2005 ; 

SearchTerm = RootFolder || Char(Year) ; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:48:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-open-folder-with-unique-identifier-in-name-but-variable/m-p/48643#M27667</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-12-14T17:48:49Z</dc:date>
    </item>
  </channel>
</rss>

