<?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 How to get get text output from Run Program () into a data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750543#M93152</link>
    <description>&lt;P&gt;I use an executable which pulls data from the database, does some data manipulation and makes manipulated data available to the end user. I would like to call this executable from within JMP and get the data into a data table. The following script example generates the data as text in the log. How do I get this text into a data table with the top row as column headers?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
Clear Log ();

rp = RunProgram( 
               Executable( "C:\dataFetchCmd\dataFetchCmd.exe" ),
               //Options(),
			   ReadFunction("text");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 10:26:17 GMT</pubDate>
    <dc:creator>Neo</dc:creator>
    <dc:date>2024-04-29T10:26:17Z</dc:date>
    <item>
      <title>How to get get text output from Run Program () into a data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750543#M93152</link>
      <description>&lt;P&gt;I use an executable which pulls data from the database, does some data manipulation and makes manipulated data available to the end user. I would like to call this executable from within JMP and get the data into a data table. The following script example generates the data as text in the log. How do I get this text into a data table with the top row as column headers?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
Clear Log ();

rp = RunProgram( 
               Executable( "C:\dataFetchCmd\dataFetchCmd.exe" ),
               //Options(),
			   ReadFunction("text");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:26:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750543#M93152</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2024-04-29T10:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get get text output from Run Program () into a data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750555#M93154</link>
      <description>&lt;P&gt;Depends what you get back from run program. Sometimes using Open(Char To Blob(), "text") might be enough and sometimes not (like below)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
RP = Run Program(
	Executable("PING.EXE"/*path probably not needed*/ ),
	Options({"-n 2", "localhost"}),
	ReadFunction("text")
);
show(rp);

dt = Open(Char To Blob(RP), "text");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it is not enough you either modify the data after you have it in data table or before you build it into data table&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:49:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750555#M93154</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-29T10:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get get text output from Run Program () into a data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750735#M93201</link>
      <description>&lt;P&gt;You can use &lt;STRONG&gt;log capture&lt;/STRONG&gt; and &lt;STRONG&gt;words&lt;/STRONG&gt; to get the log window output and parse it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// OK we're good to go now.
batch interactive(1);	// New 5-17-2018 force all errors to go to the log
log_contents = log capture(
// Put your commands that write to the log here ...
	);
batch interactive(0);	// New 5-17-2018 errors will not be forced to go to the log

// Parse the log window
crlf = hex to char("0D0A");
log_list = words(log_contents, crlf);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Apr 2024 14:29:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-get-text-output-from-Run-Program-into-a-data-table/m-p/750735#M93201</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2024-04-30T14:29:58Z</dc:date>
    </item>
  </channel>
</rss>

