Difference: 0LASubrJsonParseFile ( vs. 1)

Revision 12022-05-17 - MisaghKarimi

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FullAPIList"

.JSON PARSE FILE

This subroutine parses and imports a JSON file. (Added in 6.2.0)


Usage:

      PASS         <JSON File Path>           FIELD            SHARE? N
      PASS         <Mode>                     FIELD            SHARE? N
      GOSUB    --- .JSON PARSE FILE
      *        Check for errors
      IF       --- .JSON PARSE FILE           NE

Description:

This subroutine processes a JSON file and imports it.

<JSON File Path> is an alpha field which holds the path to the JSON file.

<Mode> can be "SMALL", "MEDIUM", or "LARGE". The value for the mode specifies what file the subroutine uses to import the parsed JSON data into. If you set the mode to SMALL, the result will be written to --- JSONUS memory-related file, if you set the mode to MEDIUM, the result will be written to --- JSONUM memory-related file, and if you set the mode to LARGE, the result will be written to --- JSONUL disk-related file. The difference between these files is the size of the value field.

Please note that setting mode to SMALL gives you the best performance, and setting mode to LARGE gives you the worst performance. So, if you are certain that the value for each attribute doesn't exceed 256 character, use Mode=SMALL, if the value doesn't exceed 32000 characters, use Mode=MEDIUM, otherwise use Mode=LARGE.

Mode Result File Value Limit
SMALL --- JSONUS 256 Characters
MEDIUM --- JSONUM 32000 Characters
LARGE --- JSONUL 1048200 Characters

To parse a JSON string use .JSON PARSE subroutine.

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback