<?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: Runprogram with Space Char in FilePath in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337706#M58526</link>
    <description>&lt;P&gt;Previous comment on using quotation marks:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use a CMD window (the black DOS box window) to see how windows wants the command done with quotation marks:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Use quotation marks around parameters with embedded spaces" style="width: 776px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28632iB3ED697DE8C9D4F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Use quotation marks around parameters with embedded spaces" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Use quotation marks around parameters with embedded spaces&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you have that working, you need to bring it in to a JMP string, which requires some sort of escaping since JMP also uses quotation marks. For this example, just escape the two quotation marks using \!"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filename = "c:\Program Files\Common Files\System\Ole DB\oledbjvs.inc";
write("filename = ", filename); // no quotation marks

txt = runprogram(executable("python"), options({
	"\!"" || filename || "\!""
}),readfunction("text"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Use the "write" function in JMP, not the "print" function which adds more confusion by wrapping the printed text with quotation marks.&lt;/P&gt;&lt;P&gt;You could also build the quotation marks into the string, but the JSL above is what you need if you get the filename from something like the filesInDirectory function...you still need to add them. You can add quotation marks even if they are not needed. See the link at the top if you have quotation marks in the middle of the file name for some reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 15:44:59 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-11-26T15:44:59Z</dc:date>
    <item>
      <title>Runprogram with Space Char in FilePath</title>
      <link>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337682#M58521</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently I'm struggeling with executing a &lt;EM&gt;runprogram&lt;/EM&gt; command with a filepath containing a space char:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myPath = "C:\Users\FilePath\Test.py"
myInfo = runprogram(executable("python"), options({myPath}),readfunction("text"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works perfetly, but when the filepath contains a space - the path is cut off, thus the file cannot be found:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myPath = "C:\Users\File Path\Test.py"
myInfo = runprogram(executable("python"), options({myPath}),readfunction("text"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Maybe someone can help me - thanks,&lt;/P&gt;&lt;P&gt;DG&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 21:59:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337682#M58521</guid>
      <dc:creator>D_G</dc:creator>
      <dc:date>2023-06-09T21:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Runprogram with Space Char in FilePath</title>
      <link>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337706#M58526</link>
      <description>&lt;P&gt;Previous comment on using quotation marks:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use a CMD window (the black DOS box window) to see how windows wants the command done with quotation marks:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Use quotation marks around parameters with embedded spaces" style="width: 776px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28632iB3ED697DE8C9D4F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Use quotation marks around parameters with embedded spaces" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Use quotation marks around parameters with embedded spaces&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you have that working, you need to bring it in to a JMP string, which requires some sort of escaping since JMP also uses quotation marks. For this example, just escape the two quotation marks using \!"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;filename = "c:\Program Files\Common Files\System\Ole DB\oledbjvs.inc";
write("filename = ", filename); // no quotation marks

txt = runprogram(executable("python"), options({
	"\!"" || filename || "\!""
}),readfunction("text"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Use the "write" function in JMP, not the "print" function which adds more confusion by wrapping the printed text with quotation marks.&lt;/P&gt;&lt;P&gt;You could also build the quotation marks into the string, but the JSL above is what you need if you get the filename from something like the filesInDirectory function...you still need to add them. You can add quotation marks even if they are not needed. See the link at the top if you have quotation marks in the middle of the file name for some reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 15:44:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337706#M58526</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-11-26T15:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Runprogram with Space Char in FilePath</title>
      <link>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337707#M58527</link>
      <description>&lt;P&gt;Hi Craige,&lt;/P&gt;&lt;P&gt;thank you very much - actually I saw the post but didn't manage to adapt it.&lt;BR /&gt;Thanks again, works perfectly !&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:06:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Runprogram-with-Space-Char-in-FilePath/m-p/337707#M58527</guid>
      <dc:creator>D_G</dc:creator>
      <dc:date>2020-11-26T16:06:57Z</dc:date>
    </item>
  </channel>
</rss>

