Problem description & analysis
Below is data in JSON file json.json:
To convert the multilevel JSON file into a two-dimensional structure while splitting the two subfields under identities field and promoting them to the parent level, and store data as a CSV file as follows:
Solution:
We write the following script p1.dfx in esProc:
A1 Read data of the JSON file as a string.
A2 Parse the string into a multilevel table sequence according to the original structure while splitting and promoting identities.signInType and identities.issuerAssignedId to their parent level with the new function.
A3 Export A2’s result to json.csv.
See How to Call an SPL Script in Java to learn about the way of integrating the SPL code with a Java program.
Top comments (0)