<?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 Saving files to created folder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62184#M33506</link>
    <description>&lt;P&gt;I am trying to save a journal and pdf to a folder after they are created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First I use pick directory to get the files I want to analyze. When this is done, the files are saving into that directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I want them to save into a folder with the date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I have tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Main Menu( "Minimize All" );
path = Pick Directory( "Select a directory" );
Set Default Directory( path );
files = Files In Directory( path );
output = Create Directory( path || Substitute( MDYHMS( Today() ), "/", "-", ":", "." ) || "/" );
&amp;nbsp;
It then goes into a for loop to create the graphs
At the end of the for loop you have
jrn &amp;lt;&amp;lt;
SaveJournal( path || files[i] || ".jrn" );
Current Journal() &amp;lt;&amp;lt; close window();

report &amp;lt;&amp;lt; SavePDF( path || files[i] || ".pdf" );
report &amp;lt;&amp;lt; close window();
dt &amp;lt;&amp;lt; close window;
org &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;For the saved parts, Ive tried path || output|| ... and I've also tried add "/" - none of these seem to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now its saving into the directory as far as path, but I want it to go one step further into output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jul 2018 18:08:27 GMT</pubDate>
    <dc:creator>conroyco</dc:creator>
    <dc:date>2018-07-05T18:08:27Z</dc:date>
    <item>
      <title>Saving files to created folder</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62184#M33506</link>
      <description>&lt;P&gt;I am trying to save a journal and pdf to a folder after they are created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First I use pick directory to get the files I want to analyze. When this is done, the files are saving into that directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I want them to save into a folder with the date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I have tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Main Menu( "Minimize All" );
path = Pick Directory( "Select a directory" );
Set Default Directory( path );
files = Files In Directory( path );
output = Create Directory( path || Substitute( MDYHMS( Today() ), "/", "-", ":", "." ) || "/" );
&amp;nbsp;
It then goes into a for loop to create the graphs
At the end of the for loop you have
jrn &amp;lt;&amp;lt;
SaveJournal( path || files[i] || ".jrn" );
Current Journal() &amp;lt;&amp;lt; close window();

report &amp;lt;&amp;lt; SavePDF( path || files[i] || ".pdf" );
report &amp;lt;&amp;lt; close window();
dt &amp;lt;&amp;lt; close window;
org &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;For the saved parts, Ive tried path || output|| ... and I've also tried add "/" - none of these seem to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now its saving into the directory as far as path, but I want it to go one step further into output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 18:08:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62184#M33506</guid>
      <dc:creator>conroyco</dc:creator>
      <dc:date>2018-07-05T18:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Saving files to created folder</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62208#M33519</link>
      <description>&lt;P&gt;I think the issue may be that the assignment of your "output" variable is not producing the result you're expecting. Try this:&lt;BR /&gt;output = path||substitute(MDYHMs(Today()), "/", "-", ":", ".")||"/";&lt;BR /&gt;Create Directory ( output );&lt;BR /&gt;&lt;BR /&gt;Then, when you go to save your report, the following should work for you:&lt;BR /&gt;report &amp;lt;&amp;lt; SavePDF ( output || files[i] || ".pdf");&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 14:16:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62208#M33519</guid>
      <dc:creator>jerry_cooper</dc:creator>
      <dc:date>2018-07-05T14:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Saving files to created folder</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62209#M33520</link>
      <description>Great, just tried it there and it worked !&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jul 2018 14:20:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-files-to-created-folder/m-p/62209#M33520</guid>
      <dc:creator>conroyco</dc:creator>
      <dc:date>2018-07-05T14:20:43Z</dc:date>
    </item>
  </channel>
</rss>

