<?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: JSL Saving txt files with Windows end of line ( EOL CRLF ) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339534#M58777</link>
    <description>&lt;P&gt;I am after this, otherwise a bat file will not be executed just printed out.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FN_0-1607265005629.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28738iB85B96D4D07B21C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FN_0-1607265005629.png" alt="FN_0-1607265005629.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 06 Dec 2020 14:30:41 GMT</pubDate>
    <dc:creator>FN</dc:creator>
    <dc:date>2020-12-06T14:30:41Z</dc:date>
    <item>
      <title>JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339509#M58774</link>
      <description>&lt;P&gt;I have a string which I want to save with end of line compatible with Windows (CRLF EOL).&lt;/P&gt;&lt;P&gt;How or when can I specified such thing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
clear log();

my_string = "\[Hello
""
World!]\";

show(my_string);

Write(my_string);

// prints in JMP Log
// "Hello
// ""
// World!"

saveTextFile("$desktop/my_text.txt", my_string );&lt;BR /&gt;&lt;BR /&gt;//&amp;nbsp;See&amp;nbsp;output&amp;nbsp;in&amp;nbsp;Notebook++&amp;nbsp;below&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FN_0-1607252573736.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28734i67E5F8B2BC94418C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FN_0-1607252573736.png" alt="FN_0-1607252573736.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the desired output I am after:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FN_1-1607264959849.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28737iDF45212BCE8EF631/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FN_1-1607264959849.png" alt="FN_1-1607264959849.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 21:59:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339509#M58774</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2023-06-09T21:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339529#M58775</link>
      <description>&lt;P&gt;This is handled with Escape Sequences.&amp;nbsp; Documented in the Scripting Guide, available in the JMP Documentation Library under the Help pull down menu.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="crlf.PNG" style="width: 438px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28735i6095376B552FE2D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="crlf.PNG" alt="crlf.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 13:35:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339529#M58775</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-06T13:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339530#M58776</link>
      <description>&lt;P&gt;I think the text has been saved correctly with Windows end of line (at least at my System win 10 JMP 15).&lt;/P&gt;
&lt;P&gt;I opened the file in Notepad and saw no issue,&lt;/P&gt;
&lt;P&gt;but if I check (view-&amp;gt; Show Symbol -&amp;gt; not printable characters -&amp;gt; Show Symbols -&amp;gt; Show end of line) I see the same as you, see screenshot.&lt;/P&gt;
&lt;P&gt;Please check your Settings in Notepad, or use different Program ..&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="notepad_CR.PNG" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28742i7BEE4B392B19D866/image-size/medium?v=v2&amp;amp;px=400" role="button" title="notepad_CR.PNG" alt="notepad_CR.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 17:13:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339530#M58776</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-12-06T17:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339534#M58777</link>
      <description>&lt;P&gt;I am after this, otherwise a bat file will not be executed just printed out.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FN_0-1607265005629.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28738iB85B96D4D07B21C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FN_0-1607265005629.png" alt="FN_0-1607265005629.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 14:30:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339534#M58777</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2020-12-06T14:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339535#M58778</link>
      <description>&lt;P&gt;Sorry, haven't understood fully your initial question, you're right.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 14:55:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339535#M58778</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-12-06T14:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339619#M58781</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;has the right answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;my_string = "Hello\!N\!"\!"\!NWorld!\!N";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Dec 2020 17:24:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339619#M58781</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-12-06T17:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Saving txt files with Windows end of line ( EOL CRLF )</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339664#M58794</link>
      <description>&lt;P&gt;Sometimes JMP is too helpful with the CR LF normalization for the OS it is running on. If you know exactly the byte sequence you want, make a blob and use SaveTextFile to save the blob. Something like (untested, but close...)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt =&amp;nbsp;"my\!ntext\!r.";
filename = SaveTextFile("$temp/x.bat", charToBlob( txt ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;second edit:&amp;nbsp; you can test like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt = "my\!ntext\!r.";
filename = SaveTextFile("$temp/x.bat", charToBlob( txt ) );
write(loadtextfile(filename,BLOB));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Char To Blob( "my~0Atext~0D.", "ascii~hex" )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;which shows the binary data found in the re-loaded file. ~0A is the hex code for the line feed and 0D for the carriage return.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;third edit: use \!N (capital N) if your JSL is running on windows. It will make the CRLF on Win, something else if running on Mac. Do NOT press return in the middle of a quoted string in the JMP editor window; that will only make a CR (on windows JMP, can't tell you about Mac JMP, except it will be different.)&lt;/P&gt;&lt;P&gt;For portable results (JSL running on Win and Mac), use \!r\!n (lower case r and n) AND the charToBlob() function with saveTextFile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 01:05:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Saving-txt-files-with-Windows-end-of-line-EOL-CRLF/m-p/339664#M58794</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-12-07T01:05:09Z</dc:date>
    </item>
  </channel>
</rss>

