<?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: Change folder name where the jmp file is stored in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45102#M25777</link>
    <description>&lt;P&gt;The Rename File() function allows you to change the file name. &amp;nbsp;It will honor blanks withing the names, as will an Open() function. &amp;nbsp;What am I missing?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2017 00:42:22 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-09-26T00:42:22Z</dc:date>
    <item>
      <title>Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45090#M25769</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing a bunch of automation from the user input.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if C:\Files\A\B files\data.jmp directory exists and currently I am getting Get default directory() function to get the entire path (&lt;SPAN&gt;C:\Files\A\B files\)&lt;/SPAN&gt;as I store the script in the same folder.&lt;/P&gt;&lt;P&gt;I want to change folder B files to B_files. Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 21:17:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45090#M25769</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-25T21:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45092#M25771</link>
      <description>&lt;P&gt;Here is the example taken directly from the Scripting Index for&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Scripting Index==&amp;gt;Functions==&amp;gt;Rename Directory&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Delete Directory( "$TEMP/subD" );
Delete Directory( "$TEMP/Loss Function Templates" );
rc0 = Copy Directory(
	"$SAMPLE_DATA/Loss Function Templates",
	"$TEMP"
);
rc1 =
Rename Directory(
	"$TEMP/Loss Function Templates",
	"subD" /* NO PATH */
);
rc2 =
Directory Exists( "$TEMP/Loss Function Templates" );
rc3 = Directory Exists( "$TEMP/subD" );
rc4 = Delete Directory( "$TEMP/subD" );
rc5 = Directory Exists( "$TEMP/subD" );
Char( rc0 ) || " " || Char( rc1 ) || " " ||
Char( rc2 ) || " " || Char( rc3 ) || " " ||
Char( rc4 ) || " " || Char( rc5 );/* 1 1 0 1 1 0 */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 21:34:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45092#M25771</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-09-25T21:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45098#M25773</link>
      <description>Thank you txnelson for the suggestion. I went back and checked. Looks like I can't change the filename. Is there a way to ignore the space in calling or opening the file from the directory?</description>
      <pubDate>Mon, 25 Sep 2017 23:41:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45098#M25773</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-25T23:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45102#M25777</link>
      <description>&lt;P&gt;The Rename File() function allows you to change the file name. &amp;nbsp;It will honor blanks withing the names, as will an Open() function. &amp;nbsp;What am I missing?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 00:42:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45102#M25777</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-09-26T00:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45108#M25782</link>
      <description>&lt;P&gt;Here's some regex to help with the name change&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;old = Get Default Directory(); // lucky it uses posix style forward slash...
Print( old ); // "/C:/Users/v1/Desktop/B Files/"
last = Regex( old, "([^/]+)/?$", "\1" ); // "B Files"
fixed = Regex( last, "[ @$]", "_", GLOBALREPLACE ); // "B_Files"
Rename Directory( old, fixed );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first regex isolates the final sub directory. The second regex changes space,&amp;nbsp;@ and $ to underscore. The first regex would need some ugly escaping if the path used back slashes. The first regex says "find a run of one or more characters that are not /, followed by an optional /, followed by the end of string." The parens form the backref \1 for the result. The second regex uses a character class in [ ] in case you have more than one special character to remove,&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 02:33:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45108#M25782</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-26T02:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45109#M25783</link>
      <description>&lt;P&gt;more thoughts: this may be not be a good idea, especially if you are renaming the current directory out from under the user. It makes it hard to save the script you just opened from the current directory. It is also going to fail the rename if your user makes "B Files" again when B_Files exists from a previous run. Be sure to test the return code from the rename function!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 02:29:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45109#M25783</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-26T02:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45142#M25803</link>
      <description>I agree with your point Craige. Thats you, I am trying to figure out a way to ignore the space. I have the problem if I try to run the location with an ip address. If I just open it normally I don't have the problem.</description>
      <pubDate>Tue, 26 Sep 2017 16:44:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45142#M25803</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-26T16:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45160#M25815</link>
      <description>&lt;P&gt;Regular expressions are great for doing these sorts of tasks. There are lots of regex resources on the web and at least &lt;A href="https://community.jmp.com/t5/Uncharted/Regex/ba-p/21008" target="_blank"&gt;this&lt;/A&gt;&amp;nbsp;and &lt;A href="https://community.jmp.com/t5/Uncharted/Back-Reference/ba-p/21267" target="_blank"&gt;this&lt;/A&gt;&amp;nbsp;I've posted in the community. In the example above, you could compare &lt;EM&gt;&lt;STRONG&gt;last == fixed&lt;/STRONG&gt;&lt;/EM&gt; to determine if you need to rename the directory.&lt;/P&gt;
&lt;P&gt;I don't understand what you want to do with an IP address. You can't use JMP's rename functions to do anything to a URL. Rename only works on a disk that you have read/write access.&lt;/P&gt;
&lt;P&gt;However, you can manipulate a URL (using regex or other JSL functions) before using it. For example, you could parse the URL for this page&amp;nbsp;and rebuild it. The JSL could use regex, or &lt;EM&gt;&lt;STRONG&gt;words(URL,"/")&lt;/STRONG&gt;&lt;/EM&gt;, or other string functions.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;URL="community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45142";
w = words(URL,"/");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;{"community.jmp.com", "t5", "Discussions",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"Change-folder-name-where-the-jmp-file-is-stored", "m-p", "45142"}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You could manipulate that list and rebuild the string&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;w[5] = "xyzzy";&lt;BR /&gt;concatitems( w ,"/");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;"community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/xyzzy/45142"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;That's a 404-page not found URL, of course.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 20:31:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45160#M25815</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-26T20:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change folder name where the jmp file is stored</title>
      <link>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45161#M25816</link>
      <description>These are amazing resources. Thank you Craige.&lt;BR /&gt;&lt;BR /&gt;Thank you txnelson for helping me initially also.</description>
      <pubDate>Tue, 26 Sep 2017 20:45:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45161#M25816</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-26T20:45:59Z</dc:date>
    </item>
  </channel>
</rss>

