1 Reply Latest reply on Sep 23, 2009 2:59 PM by Whitetimer

    Convert CSV to XML ?

    Whitetimer Level 1

      Hi All

       

      I have a CSV file :-

      198.623993,128.998596,0.907
      198.655502,123.979103,0.923
      198.673492,118.691200,0.940
      198.688995,113.624802,0.956
      198.698502,108.301598,0.973
      198.697693,103.197502,0.989
      

       

      which i would like to convert to an XML file like so :-

      <xml>
           <segment id=1>
                <left = 198.623993 />
                <centre = 128.998596 />
                <right = 0.907 />     
           </segment>
           <segment id=2>
                <left = 198.655502 />
                <centre = 123.979103 />
                <right = 0.923 />
           </segment>
           <segment id=3>
                <left = 198.673492 />
                <centre = 118.691200 />
                <right = 0.940 />
           </segment>
           <segment id=4>
                <left = 198.688995 />
                <centre = 113.624802 />
                <right = 0.956 />
           </segment>
           <segment id=5>
                <left = 198.698502 />
                <centre = 108.301598 />
                <right = 0.973 />
           </segment>
      </xml>
      

      etc

       

      How would i go about this ... ?

       

      Many Thanks

       

      Whitetimer