IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  csv to xml

    Posted 12/07/12 02:16 AM

    Originally posted by: Muk1234


    hello, I have a csv file muk.csv. I want to convert the input values in the csv file to an xml file. I don't know how to interpret the headesr s in the csv file, I mean i just want the values to be mapped and not the headers. The header names come as an output in the generated xml file. So if I have the following input: Name,Id,TotalRec
    Muks,mp1,2
    TransID,Amt,Desc
    trans1,$100,asd
    trans2,$200,dld
    Expected output: <Id>Muks</Id>
    <transId>trans1</transId>
    <AmtProcessed>100</AmtProcessed>
    <Details>asd</Details>
    <Id>Muks</Id>
    <transId>trans2</transId>
    <AmtProcessed>200</AmtProcessed>
    <Details>dld</Details>
    what i am getting is something like this: <Id>Name</Id>
    <transId>Id</transId>
    <AmtProcessed>TotalRec</AmtProcessed>
    <Details>Muks</Details>
    <Id>mp1</Id>
    <transID>2</transId>.......ans so on
    So basically it is treating header names as input. I just want the values. Can anyone help me on this please?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: csv to xml

    Posted 12/07/12 06:27 AM

    Originally posted by: SystemAdmin


    If you can't get rid of the headers, the solution would be to ignore them either via the type tree (which means creating a specific group for the headers) or only process from the second one (using EXTRACT to select what you pass to the fmap)
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: csv to xml

    Posted 12/10/12 08:41 AM

    Originally posted by: Muk1234


    Thankyou Laurent and Paul. I made an extra group of headers in the type tree. It worked.

    Regards
    Muk1234
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: csv to xml

    Posted 12/07/12 07:02 AM

    Originally posted by: paul.brett


    As a follow-up to Laurent's suggestion, as you don't need to map the header row, just define it as a text blob with a terminator of whatever is currently your row delimiter (I assume a <NL> character).

    You're not mapping this data, so you can chuck it all into a very simple Typetree object for greater mapping speed.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender