cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert Text file to XML

Former Member
0 Likes
1,559

Hello Experts,

I have a requirement to convert text file to XML. The text file is of below format:

Records=2

Rec1=12345.xyz

Rec2=9876.xyz

[Separator]

Rec1=ABCD-4567

Rec2=LMNO-1023

The above file should be converted to below XML:

<Message_Name>

     <Node>

          <Field1>12345.xyz</Field1>

          <Field2>ABCD-4567</Field2>

     </Node>

     <Node>

          <Field1>9876.xyz</Field1>

          <Field2>LMNO-1023</Field2>

     </Node>

</Message_Name>

Please note that there can be any number of records (10/ 50/ 100.....etc).

Any solution to above requirement?

Thank you!

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Likes

Hi Pankaj,

Udo is right. The simple file content conversion function in file sender channel will not do the job here.

You may need external program or write a module processor to get it done.

Regards,

Daniel

Former Member
0 Likes

Hi Daniel,

Yes, even I tried with FCC at first but could not find the right parameters, even XSLT does not help.

I will try with a module to convert the data into XML; will get back if I stuck somewhere.

Thank you!

Former Member
0 Likes
Former Member
0 Likes

Hi,

only file content conversion is not enough here. There is no standard for this file format. You need a kind of mapping logic to convert the adapter result to the expected xml.

/Udo

Hil1
Contributor
0 Likes

Dear Pankaj,

if you are using the Seeburger-BIC-Adapter for your EDI requirements, you can use it as well for such requirements like CSV-FIle, Text-files...

Otherwise, the Content-Conversion-Option as mentioend by Dimitri should should also be able to do it (if using the File-Adapter).

Kind Regards

Stefan

Dimitri
Active Contributor
0 Likes

Dear Pankaj,

Have a look at the file content conversion option in a sender file communication channel.

Kind regards,

Dimitri