<?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: Save Log Window To File, Append If File Exists in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Save-Log-Window-To-File-Append-If-File-Exists/m-p/358746#M60881</link>
    <description>&lt;P&gt;Yes. Here's the heart of the answer:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Save Text File( "$desktop/log.txt", 
    Concat Items( Get Log(), "\!N" ), 
    Mode( If( File Exists("$desktop/log.txt"), "append", "replace" ) ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As shown, it adds some unwanted text to the log, and may not add some text you do want. If you make it an add-in, nothing is added to the log.&lt;/P&gt;&lt;P&gt;You might want a separator, or a date. You could concatenate those to the Concat Items() result.&lt;/P&gt;&lt;P&gt;You might want a file name prompt; you can add that as well.&lt;/P&gt;&lt;P&gt;Edit: And it might make sense to Clear Log() if you plan to do multiple appends in one session.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Feb 2021 06:26:27 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-02-13T06:26:27Z</dc:date>
    <item>
      <title>Save Log Window To File, Append If File Exists</title>
      <link>https://community.jmp.com/t5/Discussions/Save-Log-Window-To-File-Append-If-File-Exists/m-p/358707#M60876</link>
      <description>&lt;P&gt;Is there a way in JSL to save contents of log window to a file and if the file exists, append to it rather than overwrite it&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Save Log("$myroot/Log_File.txt");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:06:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-Log-Window-To-File-Append-If-File-Exists/m-p/358707#M60876</guid>
      <dc:creator>ravi_sasjmp</dc:creator>
      <dc:date>2023-06-09T22:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Save Log Window To File, Append If File Exists</title>
      <link>https://community.jmp.com/t5/Discussions/Save-Log-Window-To-File-Append-If-File-Exists/m-p/358746#M60881</link>
      <description>&lt;P&gt;Yes. Here's the heart of the answer:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Save Text File( "$desktop/log.txt", 
    Concat Items( Get Log(), "\!N" ), 
    Mode( If( File Exists("$desktop/log.txt"), "append", "replace" ) ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As shown, it adds some unwanted text to the log, and may not add some text you do want. If you make it an add-in, nothing is added to the log.&lt;/P&gt;&lt;P&gt;You might want a separator, or a date. You could concatenate those to the Concat Items() result.&lt;/P&gt;&lt;P&gt;You might want a file name prompt; you can add that as well.&lt;/P&gt;&lt;P&gt;Edit: And it might make sense to Clear Log() if you plan to do multiple appends in one session.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 06:26:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-Log-Window-To-File-Append-If-File-Exists/m-p/358746#M60881</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-02-13T06:26:27Z</dc:date>
    </item>
  </channel>
</rss>

