I want to read a text file to output a JSON file.
The text file contains an array of objects called ‘SGA.’
Each ‘SGA’ object has a 2-character ID and an array of objects called ‘LG,’ which contains a single element: an amount represented by 3 characters.
The challenge is that each line can have a variable number of ‘LG’ arrays, ranging from 0 to 10.
this solution dont work
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://www.oracle.com/FTPAdapter"
targetNamespace="http://www.oracle.com/FTPAdapter"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:version="NXSD"
nxsd:stream="chars"
nxsd:encoding="US-ASCII">
\<xsd:element name="SGAListe">
\<xsd:complexType>
\<xsd:sequence>
\<xsd:element name="SGA" minOccurs="0" maxOccurs="unbounded" nxsd:style="array" nxsd:cellSeparatedBy="\\n" >
\<xsd:complexType>
\<xsd:sequence>
\<xsd:element name="id" type="xsd:string" nxsd:style="fixedLength" nxsd:length="2" nxsd:padStyle="tail"/>
\<xsd:element name="LG" maxOccurs="10" nxsd:style="array" >
\<xsd:complexType>
\<xsd:sequence>
\<xsd:element name="amount" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" nxsd:padStyle="tail" />
\</xsd:sequence>
\</xsd:complexType>
\</xsd:element>
\</xsd:sequence>
\</xsd:complexType>
\</xsd:element>
\</xsd:sequence>
\</xsd:complexType>
\</xsd:element>
</xsd:schema>