<?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: Continue how to use JSL to process the JSON file from the web download? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229157#M45438</link>
    <description>Thank Craige_Hales! with this regex code I was able to combine the methods of dealing with the regex in VBA.&lt;BR /&gt;But using regex processing in JSL is something I'll continue to learn.</description>
    <pubDate>Sat, 12 Oct 2019 08:27:09 GMT</pubDate>
    <dc:creator>lwx228</dc:creator>
    <dc:date>2019-10-12T08:27:09Z</dc:date>
    <item>
      <title>Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228962#M45408</link>
      <description>&lt;P&gt;Hello everyone!I continue to try the JSL download of the WEB JSON file, and since the JSON structure is different, the successful download of the JSON in the JSL log, but the structure of the JSON file is different, I don't know how to arrange it into a table with JSL.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;url="http://pdfm.eastmoney.com/EM_UBG_PDTI_Fast/api/js?rtntype=5&amp;amp;token=4f1862fc3b5e77c150a2b985b12db0fd&amp;amp;cb=jQuery18308309053384067384_1570754165747&amp;amp;id=6037121&amp;amp;type=m5k&amp;amp;authorityType=fa&amp;amp;_=1570754540714";
dt = Open(url, JSON );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-10-11_15-08.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19634i8645F5B59DFAD287/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-10-11_15-08.png" alt="2019-10-11_15-08.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using browser to download the JSON file, remove the log message for an error, and then process it with JSL, can get the table, but the table is not what I want.Please advice from experts.Thank you very much!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-10-11_15-14.png" style="width: 793px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19635i3FCFD78C23C486ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-10-11_15-14.png" alt="2019-10-11_15-14.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 07:44:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228962#M45408</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-11T07:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228972#M45409</link>
      <description>&lt;P&gt;&lt;BR /&gt;I searched for posts that might be handled with this code, but tried and failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;headers( {"…… "} )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2019 07:38:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228972#M45409</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-11T07:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228974#M45410</link>
      <description>&lt;P&gt;&lt;SPAN class="transSent"&gt;How to write JSL to download JSON directly from the WEB and automatically process it to get a normalized table?&lt;/SPAN&gt;&lt;SPAN class="transSent"&gt;Thanks!&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-10-11_15-48.png" style="width: 727px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19636iE175703B46018CFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-10-11_15-48.png" alt="2019-10-11_15-48.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 07:52:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/228974#M45410</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-11T07:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229145#M45436</link>
      <description>&lt;P&gt;You'll have to split up the &lt;EM&gt;data&lt;/EM&gt; column; JMP imported exactly what is in the JSON file...there are no other column names and &lt;EM&gt;data&lt;/EM&gt; is a single field. You can make new columns (with the name you need) using formulas similar to this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use the word() function with comma for the delimiter; this example selects the 3rd item between commas" style="width: 991px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19665i82FC8E81BA5B871F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="use the word() function with comma for the delimiter; this example selects the 3rd item between commas" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;use the word() function with comma for the delimiter; this example selects the 3rd item between commas&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can do something like this to avoid hand-editing the downloads:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt=loadtextfile("http://pdfm.eastmoney.com/EM_UBG_PDTI_Fast/api/js?rtntype=5&amp;amp;token=4f1862fc3b5e77c150a2b985b12db0fd&amp;amp;cb=jQuery18308309053384067384_1570754165747&amp;amp;id=6037121&amp;amp;type=m5k&amp;amp;authorityType=fa&amp;amp;_=1570754540714");
txt = regex(txt,"\((.*)\)$","\1"); // strip the jQuery18308309053384067384_1570754165747( ...json data... ) wrapper
dt = jsontodatatable(txt);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The regex uses&lt;/P&gt;&lt;P&gt;\( -- this is a literal open parenthesis&lt;/P&gt;&lt;P&gt;(.*) -- this is a capturing group that grabs as much as it can into the first back reference&lt;/P&gt;&lt;P&gt;\)$ -- this is a literal close parenthesis, at the end of the string&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;"\1" says the result of the regex is whatever the capturing group found between the parentheses.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 00:02:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229145#M45436</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-10-12T00:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229157#M45438</link>
      <description>Thank Craige_Hales! with this regex code I was able to combine the methods of dealing with the regex in VBA.&lt;BR /&gt;But using regex processing in JSL is something I'll continue to learn.</description>
      <pubDate>Sat, 12 Oct 2019 08:27:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229157#M45438</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-12T08:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229159#M45439</link>
      <description>&lt;P&gt;I try to save the dt after regular processing as TXT text without Table Headers with JSL, and then read the text as TXT with JSL. How can replace the specified character of TXT with null with regex?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-10-12_16-38.png" style="width: 775px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19666i721A55ED504F2533/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-10-12_16-38.png" alt="2019-10-12_16-38.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 08:49:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229159#M45439</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-12T08:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229160#M45440</link>
      <description>&lt;P&gt;&lt;SPAN class="transSent"&gt;I don't know how to write &lt;SPAN&gt;regex&lt;/SPAN&gt; replace code in JSL.&lt;/SPAN&gt;&lt;SPAN class="transSent"&gt;Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="transSent"&gt;Replace all the following three characters&lt;BR /&gt;\"!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txt=loadtextfile("C:\Users\Administrator\Desktop\Untitled 6.txt");
txt = regex(txt,"\\",""); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 09:32:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229160#M45440</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-12T09:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229165#M45443</link>
      <description>&lt;P&gt;This has some info about the &lt;EM&gt;GLOBALREPLACE&lt;/EM&gt; option and some examples:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/Regex/ba-p/21008" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Uncharted/Regex/ba-p/21008&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure what the character is; you might need to use Unicode escapes to represent it, see \!Uxxxx here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/best-practices-around-special-characters-in-JSL/m-p/214000" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/best-practices-around-special-characters-in-JSL/m-p/214000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I *think* what is really happening is JMP is escaping some quotation marks and it looks confusing. Use the &lt;EM&gt;write()&lt;/EM&gt; function to see the test without escapes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="using write() to see strings without escapes" style="width: 759px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19667iFB78CCABEB3149F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="using write() to see strings without escapes" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;using write() to see strings without escapes&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I reformatted the text with a newline after the commas; it is actually all run together as sent from the JSON source. The data in &lt;EM&gt;txt&amp;nbsp;&lt;/EM&gt;is just " but when JMP displays the value as a quoted string (using print, for example), JMP will escape the embedded " using \!" .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is is using print(), notice the very first and last " are not escaped:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="internal &amp;quot; are escaped with \!" style="width: 812px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19669i63D97B19AB857285/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="internal &amp;quot; are escaped with \!" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;internal " are escaped with \!&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 13:12:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229165#M45443</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-10-12T13:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229168#M45444</link>
      <description>&lt;P&gt;OK.&lt;/P&gt;&lt;P&gt;Thank Craige!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-10-12_22-54.png" style="width: 427px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19671i81D5B2D99FFC23E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-10-12_22-54.png" alt="2019-10-12_22-54.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 14:54:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/229168#M45444</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2019-10-12T14:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Continue how to use JSL to process the JSON file from the web download?</title>
      <link>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/598292#M80198</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 05:07:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Continue-how-to-use-JSL-to-process-the-JSON-file-from-the-web/m-p/598292#M80198</guid>
      <dc:creator>UersK</dc:creator>
      <dc:date>2023-02-08T05:07:57Z</dc:date>
    </item>
  </channel>
</rss>

