<?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: extract the folder name from file directory in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692460#M87812</link>
    <description>&lt;P&gt;Link to (one of) the original post(s):&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/extracting-the-directory-of-a-jmp-file-in-JSL/m-p/423133/highlight/true#M67228" target="_blank"&gt;https://community.jmp.com/t5/Discussions/extracting-the-directory-of-a-jmp-file-in-JSL/m-p/423133/highlight/true#M67228&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;xx="C:\temp\myfile.txt";
theDirectory = Substr( xx, 1, Length( xx ) - Length( Word( -1, xx, "\/" ) ) - 1 );&lt;BR /&gt;&lt;BR /&gt;//"C:\temp"&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 Oct 2023 11:59:35 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-10-31T11:59:35Z</dc:date>
    <item>
      <title>extract the folder name from file directory</title>
      <link>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692348#M87805</link>
      <description>&lt;P&gt;How can I extract the folder name from file directory? I will use the folder's name as the name of the data table when saving it. I am using JMP 15.&lt;/P&gt;&lt;P&gt;I tried this piece of code I saw here but still cannot extract the folder name. I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Dir = "";

p = pick Directory("Select a Folder", Dir);
f = Files In Directory(p);

Dir = Substr( p, 1, Length( p ) - Length( Word( -1, p, "\/" ) ) - 1 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Ex.&amp;nbsp;&lt;/P&gt;&lt;P&gt;File path:&amp;nbsp;C:\Users\Animals&lt;/P&gt;&lt;P&gt;Dir = Animals&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 06:08:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692348#M87805</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-10-31T06:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: extract the folder name from file directory</title>
      <link>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692365#M87808</link>
      <description>&lt;P&gt;This should return Animals (at least it does with JMP17)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dir = "C:\Users\Animals";
foldername = Word(-1, dir, "\");
show(foldername); // foldername = "Animals";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2023 06:30:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692365#M87808</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-31T06:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: extract the folder name from file directory</title>
      <link>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692460#M87812</link>
      <description>&lt;P&gt;Link to (one of) the original post(s):&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/extracting-the-directory-of-a-jmp-file-in-JSL/m-p/423133/highlight/true#M67228" target="_blank"&gt;https://community.jmp.com/t5/Discussions/extracting-the-directory-of-a-jmp-file-in-JSL/m-p/423133/highlight/true#M67228&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;xx="C:\temp\myfile.txt";
theDirectory = Substr( xx, 1, Length( xx ) - Length( Word( -1, xx, "\/" ) ) - 1 );&lt;BR /&gt;&lt;BR /&gt;//"C:\temp"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2023 11:59:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/extract-the-folder-name-from-file-directory/m-p/692460#M87812</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-31T11:59:35Z</dc:date>
    </item>
  </channel>
</rss>

