<?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: &amp;quot;Save text file&amp;quot; issue in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259847#M50992</link>
    <description>&lt;P&gt;Your solution worked like a charm, thank you very much again! Yves&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2020 17:12:50 GMT</pubDate>
    <dc:creator>yvesprairie</dc:creator>
    <dc:date>2020-04-22T17:12:50Z</dc:date>
    <item>
      <title>"Save text file" issue</title>
      <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259599#M50958</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have ripping my (last few) hair out over the past couple of days on a script that I could not get to work on Windows while it was working fine on Mac OS. After much comparison, I elucidated that it was due to a difference on how text file are created. This file needs to be created because it serves as input to another program that I run within JMP using the JSL function "Run program". This all works fine on Mac. The initial little bit of code that produces the text file is&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filename = Eval Insert( "^simdir^^lakename^/^lakename^.par" );
	lakepar = Eval Insert(
		"\[{
  "Input" : {
    "Initial conditions"  : "^simdir^^lakename^/icond.dat",
    "Grid"                : 24,
    "Morphology"          : "^simdir^^lakename^/hypso.dat",
    "Forcing"             : "^simdir^^lakename^/forcing.dat",
    "Absorption"          : "^simdir^^lakename^/lightextinction.dat",
    "Inflow"              : "^simdir^^lakename^/Qin.dat",
    "Outflow"             : "^simdir^^lakename^/Qout.dat",
    "Inflow temperature"  : "^simdir^^lakename^/Tin.dat",
    "Inflow salinity"     : "^simdir^^lakename^/Sin.dat"
  },
.
.
.
.
  }
}
]\"
	);
	Save Text File( filename, lakepar, "replace" );&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;On Mac OS, the output text file is all neatly organized as it should and looks like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{
  "Input" : {
    "Initial conditions"  : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/icond.dat",
    "Grid"                : 24,
    "Morphology"          : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/hypso.dat",
    "Forcing"             : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/forcing.dat",
    "Absorption"          : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/lightextinction.dat",
    "Inflow"              : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/Qin.dat",
    "Outflow"             : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/Qout.dat",
    "Inflow temperature"  : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/Tin.dat",
    "Inflow salinity"     : "/Users/yvesprairie/Dropbox/sim3/Petit-Saut/Sin.dat"
  },&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but on Windows it is all like a long and continuously wrapping line. The odd thing is that I cannot even paste it here because it looks ok but when I open it in a text editor like Atom, then the files looking very different. This difference makes the file unreadable by the "Run program" executable. I thought it has to do with hidden characters but in both the Mac and Windows version I use exactly the same "save text file" options (CR+LF, and commas as end-of-field) in my preferences and I also use the option to save text file as unicode. I don't know what else to try. Any help/suggestion will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards, Yves&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 21:39:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259599#M50958</guid>
      <dc:creator>yvesprairie</dc:creator>
      <dc:date>2020-04-21T21:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: "Save text file" issue</title>
      <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259617#M50962</link>
      <description>&lt;P&gt;youi need to enter in New Line characters where you want them.&amp;nbsp; On windows the new line character sequence is \!n&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 23:05:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259617#M50962</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-04-21T23:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: "Save text file" issue</title>
      <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259708#M50966</link>
      <description>&lt;P&gt;Mac and Win (and Linux) have odd, different histories on how newlines are used. There are a number of things happening here:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you are putting some sort of newline sequence into your string. It may vary between Win and Mac.&lt;/LI&gt;&lt;LI&gt;SaveTextFile may be doing some host specific conversion on the newlines. It may vary...&lt;/LI&gt;&lt;LI&gt;Different editors may treat newline sequences differently. It may vary...&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;JMP can control the first two, and most likely you can find a set of newline characters that works for your editors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To set the newline sequences, try one of these to replace any sequence of CR and LF with a predictable sequence&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lakepar = regex(lakepar,"[\n\r]+","\!n",GLOBALREPLACE);
// or
lakepar = regex(lakepar,"[\n\r]+","\!r",GLOBALREPLACE);
// or
lakepar = regex(lakepar,"[\n\r]+","\!r\!n",GLOBALREPLACE);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;LF, CR, or CRLF are the usual possibilities for a newline sequence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To prevent savetextfile from converting newline sequences to what it thinks the host needs, save a blob:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;saveTextFile( "$desktop/x.txt", chartoblob(lakepar) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To peek at the string or file, use a blob:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show(chartoblob(lakepar));
// or
show(loadtextfile( "$desktop/x.txt", blob));// to view&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Load Text File("$desktop/x.txt", blob) = Char To Blob( "abc~0D~0Adef~0D~0Aghiu", "ascii~hex" );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;~0D is a CR and ~0A is a LF&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 02:58:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259708#M50966</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-04-22T02:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Save text file" issue</title>
      <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259789#M50977</link>
      <description>&lt;P&gt;Thank you so much Craige for the detailed explanation. I will try them and report! Thanks again, Yves&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 12:40:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259789#M50977</guid>
      <dc:creator>yvesprairie</dc:creator>
      <dc:date>2020-04-22T12:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: "Save text file" issue</title>
      <link>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259847#M50992</link>
      <description>&lt;P&gt;Your solution worked like a charm, thank you very much again! Yves&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 17:12:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/quot-Save-text-file-quot-issue/m-p/259847#M50992</guid>
      <dc:creator>yvesprairie</dc:creator>
      <dc:date>2020-04-22T17:12:50Z</dc:date>
    </item>
  </channel>
</rss>

