<?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: .json file to trend charts in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44441#M25480</link>
    <description>&lt;P&gt;Edit: too much going on...all the XML references below should be json instead...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original question also asked about using a folder name from the XML data.&amp;nbsp;That folder contains a CSV file with the actual data. The folder name is in a column with a name like&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;Infoes.Name.&lt;/EM&gt;&amp;nbsp;The dotted name represents a nested path in the XML tree. You can use that to open a file in the folder. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I recommend using the text import peview to&amp;nbsp;create a &lt;EM&gt;source&lt;/EM&gt; script that you can copy from the imported table. The script will look something like this (use right-click-&amp;gt;edit &amp;nbsp;on &lt;EM&gt;source&lt;/EM&gt; to get a copy):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Text import preview source script" style="width: 383px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/7506i9C61C62B90E3D25D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Text import preview source script" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Text import preview source script&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
    "C:\Users\v1\Desktop\stories.csv",
    columns(
        ...
    ),
    Import Settings(
        ...
    )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can replace the quoted filename on the second line with a JSL variable that contains the name of the file you actually need. I don't know if your XML file contains only one file or more than one; you might use something like this&amp;nbsp;to process all of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;For( irow = 1, irow &amp;lt;= N Rows( dtXML ), irow++,&lt;BR /&gt; filename = dtXML:Infoes.Name[irow] || "\data.csv";&lt;BR /&gt; show(filename); // check the log to see if this looks right&lt;BR /&gt; dtCSV = Open( filename, columns(...), Import Settings(...) );&lt;BR /&gt; // do something with the data&lt;BR /&gt; // ... maybe dtCSV&amp;lt;&amp;lt;Distribution(...) for example&lt;BR /&gt; // then close the table...&lt;BR /&gt; Close( dtCSV, "nosave" );&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;You'll need to think about the \ in the path name which I just stuck in front of the hard-coded data.csv name, and you might need to get the actual file name from another variable. Since there is more than one data table open, be sure to use distinctive JSL variable names to prevent confusion, and be sure to use the JSL variable name to avoid using the &lt;EM&gt;current data table&lt;/EM&gt;, since it will not be obvious what table is current.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 23:47:24 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2017-09-12T23:47:24Z</dc:date>
    <item>
      <title>.json file to trend charts</title>
      <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44255#M25452</link>
      <description>&lt;P&gt;I have been following Craige and Xan's JSON parser document. I am using JMP 13.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMP-Scripts/JSON-Parsing-Functions/ta-p/22253" target="_blank"&gt;https://community.jmp.com/t5/JMP-Scripts/JSON-Parsing-Functions/ta-p/22253&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This question may be simple to a lot of people. I am fairly new to scripting and I really appreciate your help.&lt;/P&gt;&lt;P&gt;I have a .json file automatically getting created in a folder after the user make a selection on the web( lot number, wafer number, parameter). I want to run a background script which automatically takes that .json and&amp;nbsp;it needs to access set of folders to compute the trend. Like whenever a .json file is created in that folder, script should run to compute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to append&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;include("$downloads/JSON Parser II.jsl");&lt;/PRE&gt;&lt;PRE&gt;JSON:MAKETABLE(source);&lt;/PRE&gt;&lt;P&gt;to the starting and beginning of a json script without opening the .json file? Am I in the right path or should I use .json file to implement in a different way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 19:06:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44255#M25452</guid>
      <dc:creator>vishwasanj</dc:creator>
      <dc:date>2017-09-11T19:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: .json file to trend charts</title>
      <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44275#M25453</link>
      <description>&lt;P&gt;use the LoadTextFile function to open the json file and store it into &lt;EM&gt;source&lt;/EM&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;source = LoadTextFile("$desktop/x.json");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Sep 2017 19:40:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44275#M25453</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-11T19:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: .json file to trend charts</title>
      <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44277#M25454</link>
      <description>&lt;P&gt;In JMP 13, there are built-in JSON Parsing functions. The JSON to List, Load Text File, and Open functions support the JSON file type.&lt;/P&gt;
&lt;P&gt;If you just want to convert a JSON file to a JMP Data Table, you can use the Open function with the JSON option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(  "$documents\test.json", JSON );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit:&amp;nbsp; The Open function should do the same as the JSON:MAKETABLE function from the JSON utilities.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 20:16:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44277#M25454</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-09-11T20:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: .json file to trend charts</title>
      <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44316#M25455</link>
      <description>&lt;P&gt;Didn't realize that made it into 13, cool!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 21:45:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44316#M25455</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-11T21:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: .json file to trend charts</title>
      <link>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44441#M25480</link>
      <description>&lt;P&gt;Edit: too much going on...all the XML references below should be json instead...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original question also asked about using a folder name from the XML data.&amp;nbsp;That folder contains a CSV file with the actual data. The folder name is in a column with a name like&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;Infoes.Name.&lt;/EM&gt;&amp;nbsp;The dotted name represents a nested path in the XML tree. You can use that to open a file in the folder. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I recommend using the text import peview to&amp;nbsp;create a &lt;EM&gt;source&lt;/EM&gt; script that you can copy from the imported table. The script will look something like this (use right-click-&amp;gt;edit &amp;nbsp;on &lt;EM&gt;source&lt;/EM&gt; to get a copy):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Text import preview source script" style="width: 383px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/7506i9C61C62B90E3D25D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Text import preview source script" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Text import preview source script&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
    "C:\Users\v1\Desktop\stories.csv",
    columns(
        ...
    ),
    Import Settings(
        ...
    )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can replace the quoted filename on the second line with a JSL variable that contains the name of the file you actually need. I don't know if your XML file contains only one file or more than one; you might use something like this&amp;nbsp;to process all of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;For( irow = 1, irow &amp;lt;= N Rows( dtXML ), irow++,&lt;BR /&gt; filename = dtXML:Infoes.Name[irow] || "\data.csv";&lt;BR /&gt; show(filename); // check the log to see if this looks right&lt;BR /&gt; dtCSV = Open( filename, columns(...), Import Settings(...) );&lt;BR /&gt; // do something with the data&lt;BR /&gt; // ... maybe dtCSV&amp;lt;&amp;lt;Distribution(...) for example&lt;BR /&gt; // then close the table...&lt;BR /&gt; Close( dtCSV, "nosave" );&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;You'll need to think about the \ in the path name which I just stuck in front of the hard-coded data.csv name, and you might need to get the actual file name from another variable. Since there is more than one data table open, be sure to use distinctive JSL variable names to prevent confusion, and be sure to use the JSL variable name to avoid using the &lt;EM&gt;current data table&lt;/EM&gt;, since it will not be obvious what table is current.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 23:47:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/json-file-to-trend-charts/m-p/44441#M25480</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-09-12T23:47:24Z</dc:date>
    </item>
  </channel>
</rss>

