Flat File to XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raginireddy
    New Member
    • Oct 2006
    • 2

    Flat File to XML

    Hi ,


    I had a Flat file with the following Data

    B10001 U1001 IT2003 12-04-1999 S
    B10001 U1001 IT2004 04-05-1999 S
    B10001 U2001 IT2005 07-06-2000 S
    XWQ01 XWB2 IXIT00 11-04-1998 S

    It must be converted to an XML that will look as below

    <Order>
    <Box>
    <BId> B10001</BId>
    <UNIT>
    <UId>U1001</UId>
    <ITEM>
    <ID>IT2003</ID>
    <Date>12-04-1999</Date>
    <Remarks>S</Remarks>
    </ITEM>
    <ITEM>
    <ID>IT2004</ID>
    <Date>04-05-1999</Date>
    <Remarks>S</Remarks>
    </ITEM>
    </UNIT>
    <UNIT>
    <UId>U1001</UId>
    <ITEM>
    <ID>IT2005</ID>
    <Date>07-06-2000</Date>
    <Remarks>S</Remarks>
    </ITEM>
    </UNIT>
    </Box>
    <Box>
    <BId> XWQ01 </BId>
    <UNIT>
    <UId>XWB2 </UId>
    <ITEM>
    <ID>IXIT00</ID>
    <Date>11-04-1998 </Date>
    <Remarks>S</Remarks>
    </ITEM>

    Plz help me to do this ,Ican't able to Group this i ma geeting the BoxId's and also UnitId's Repetedly . Can anyone define a method to get this output fro mthe given flat file
Working...