-3

テキスト ファイルを XML に変換する必要があります。テキスト ファイルの形式は次のとおりです。

Records=2
Rec1=12345.xyz //Value is of Fixed length (9)
Rec2=98765.xyz //Value is of Fixed Length (9)
[Separator]
Rec1=ABCD-456 //Value is of Fixed Length (8)
Rec2=LMNO-102 //Value is of Fixed Length (8)

上記のファイルは、以下の XML に変換する必要があります。

<Message_Name>
     <Node>
          <Field1>12345.xyz</Field1>
          <Field2>ABCD-456</Field2>
     </Node>
     <Node>
          <Field1>9876.xyz</Field1>
          <Field2>LMNO-102</Field2>
     </Node>
</Message_Name>

任意の数のレコードが存在する可能性があることに注意してください (10/ 50/ 100 など)。

上記の要件に対する解決策はありますか?

ありがとう!

4

1 に答える 1