cancel
Showing results for 
Search instead for 
Did you mean: 

XML to CSV conversion in File (SFTP) to File (SFTP) scenario

0 Kudos

Hi All,

I am working on File(XML) to File (Pipe delimited text file) scenario. My requirement is, first line in the file should be name of the fields followed by values of the fields from the next line and so on.

Example: A|B|C-------->Name of the fields

               1|2|3---------->Value of the fields

               4|5|6---------->Value of the fields......and so on.

I am able to execute the scenario without first line using MTB in SFTP. But how to incorporate the name of the fields? Please suggest.

Thanks in advance,

Vaibhav Mishra

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

Hi,

You can add header line in MTB. Refer to the below discussion

0 Kudos

Hi Adarsh,

Thanks for the quick response.Please check am I missing something. I am using MTB because of SFTP.

XML2Plain    Transform.Class                 com.sap.aii.messaging.adapter.Conversion

XML2Plain    Transform.ContentType          text/plain;charset=utf-8

XML2Plain    xml.DETAIL.addHeaderLine    1

XML2Plain    xml.DETAIL.endSeparator      'nl'

XML2Plain    xml.DETAIL.fieldSeparator      |

XML2Plain    xml.DETAIL.fieldNames          Field Names of DETAIL Node

XML2Plain    xml.TRAILER.addHeaderLine    1

XML2Plain    xml.TRAILER.endSeparator    'nl'

XML2Plain    xml.TRAILER.fieldNames    Field Names of TRAILER Node

XML2Plain    xml.TRAILER.fieldSeparator    |

XML2Plain    xml.conversionType                 StructXML2Plain
XML2Plain    xml.recordsetName                Receiver MT Name

XML2Plain    xml.recordsetStructure               DETAIL,TRAILER

exit              JNDIName                                  deployedAdapters/com.sap.aii.adapter.sftp.ra/shareable/com.sap.aii.adapter.sftp.ra

My Structure is like this:-

MT_Name

     DETAIL----->1 to unbounded

          Fields of DETAIL Node

     TRAILER-->1 to 1

          Fields of TRAILER Node

Thanks in advance

Answers (0)