[KLUG Members] Python XML to CSV

agencies_ad1 at sancharnet.in agencies_ad1 at sancharnet.in
Tue Jan 31 05:00:05 EST 2006


Quoting Adam Tauno Williams <adam at morrison-ind.com>:

> Does anyone have an example for convering an XML document to a CSV, or
> something similiar, in Python?
> 
> For instance, I want to turn -
>
<row><c01>2</c01><c02>22302101</c02><c03>022</c03><c04>00</c04><c05>01/25/2006</c05><c06>5</c06><c07/><c08/><c09>2.00</c09><c10>277202</c10><c11/><c12>277202
>
WHEEL,LOAD</c12><c13>65.03</c13><c14>130.06</c14><c15/><c16/><c17>Y</c17><c18>NPP40</c18><c19>2CL02277</c19><c20/><c21/><c22/><c23/><c24/></row>
> -
> into a 24 field CSV file (with a couple of caveats, but I think I can
> figure those out).  I want to do it in Python as this example exists
> inside BIE which has an internal Python-script action.
> 

Hello,
http://www.python.org/doc/current/lib/module-csv.html

Regards,

Komal

----------------------------------------------------------------
This message was sent using NWebmail, BSNL's Webmail Program



More information about the Members mailing list