<?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: how to use jsl to read json file time column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769657#M95047</link>
    <description>&lt;P&gt;Thank you for your response! It does default to read as Character. So maybe changing it in JMP is the way to go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of the json file,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"PrimaryKey": "14240",&lt;BR /&gt;"DateTimeStamp": "2024-06-25T16:17:34.524327-05:00",&lt;BR /&gt;"DateTimeStampLocal": "2024-06-25T16:17:34.523",&lt;BR /&gt;"DateTimeStampUtc": "2024-06-25T21:17:34.524327",&lt;BR /&gt;},&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 21:42:26 GMT</pubDate>
    <dc:creator>emmablue</dc:creator>
    <dc:date>2024-07-01T21:42:26Z</dc:date>
    <item>
      <title>how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769632#M95043</link>
      <description>&lt;P&gt;I'm trying to use jsl to open a json file. The json file has a time column in the format of&amp;nbsp;yyyy-mm-ddThh:mm:ss, but I'm struggling how to read it correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use this but it was not working&lt;/P&gt;&lt;P&gt;Open(path1,JSON Settings(&lt;BR /&gt;Stack( 0 ),&lt;BR /&gt;Row( "/root/value" ),&lt;BR /&gt;Col("/root/value/datetime",&lt;BR /&gt;Column Name( "datetime" ),&lt;BR /&gt;Fill( "Use Once" ),&lt;BR /&gt;Type( "Numeric" ),&lt;BR /&gt;Format( "yyyy-mm-ddThh:mm:ss" ),&lt;BR /&gt;Input format ( "yyyy-mm-ddThh:mm:ss" ),&lt;BR /&gt;Modeling Type( "Continuous" )&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:02:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769632#M95043</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2024-07-01T21:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769644#M95045</link>
      <description>&lt;P&gt;Most likely you want to load it as string and then change the format in JMP table (I don't think JSON specification has date format and usually they are stored as strings). Could you provide small example of the JSON file with at least the date key-value pair?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:13:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769644#M95045</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-01T21:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769647#M95046</link>
      <description>&lt;P&gt;Please use the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1719868588852.png" style="width: 0px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65782i20A2A8004C590DF8/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="txnelson_0-1719868588852.png" alt="txnelson_0-1719868588852.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;icon located at the top of the Discussion input screen to copy in your JSL statements.&amp;nbsp; It really enhances the ability of the reading and understanding of the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:18:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769647#M95046</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-07-01T21:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769657#M95047</link>
      <description>&lt;P&gt;Thank you for your response! It does default to read as Character. So maybe changing it in JMP is the way to go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of the json file,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"PrimaryKey": "14240",&lt;BR /&gt;"DateTimeStamp": "2024-06-25T16:17:34.524327-05:00",&lt;BR /&gt;"DateTimeStampLocal": "2024-06-25T16:17:34.523",&lt;BR /&gt;"DateTimeStampUtc": "2024-06-25T21:17:34.524327",&lt;BR /&gt;},&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:42:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769657#M95047</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2024-07-01T21:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769658#M95048</link>
      <description>&lt;P&gt;Will do!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:42:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769658#M95048</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2024-07-01T21:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769667#M95054</link>
      <description>&lt;P&gt;When you get the data to JMP table (Preview might work)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1719894398349.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65785iB4F03F87A19A671B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1719894398349.png" alt="jthi_0-1719894398349.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;you can then use Word() (or Words()) and InFormat() (I suggest using Format Pattern with it) to clean your strings. If you need to keep the decimals it will be more complicated as you will have to handle those separately and same for the timezone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a small example which gives an idea what you can do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "2024-06-25T16:17:34.524327-05:00";
{firstpart, lastpart} = Words(str, ".");

date = Informat(firstpart, "Format Pattern", "&amp;lt;YYYY&amp;gt;-&amp;lt;MM&amp;gt;-&amp;lt;DD&amp;gt;T&amp;lt;hh24&amp;gt;:&amp;lt;mm&amp;gt;:&amp;lt;ss&amp;gt;");
dec = Num("0." || Word(1, lastpart, "-+"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jul 2024 04:33:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769667#M95054</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-02T04:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769814#M95070</link>
      <description>&lt;P&gt;Not sure if I followed this. But I followed your first suggestion to read the json file in as string, and then change it to numeric time format later. And it worked! Thank you again for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:25:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769814#M95070</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2024-07-02T15:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to use jsl to read json file time column</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769815#M95071</link>
      <description>&lt;P&gt;JMP might be able to directly change the format of your date strings to JMP datenum and that happens when you convert the columns to numeric. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using In Format() is for cases where you have to do something more complicated for the string formatted dates (sometimes required).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 15:28:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-jsl-to-read-json-file-time-column/m-p/769815#M95071</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-02T15:28:20Z</dc:date>
    </item>
  </channel>
</rss>

