@rplrpl/

XML to CSV 201904

Python

No description

fork
loading
Files
  • main.py
  • fleet_input.xml

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.016355376766694407","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHhtbC5ldHJlZS5FbGVtZW50VHJlZQppbXBvcnQgcGFuZGFzCmNhcl9kZXRhaWxzID0gW3guYXR0cmliIGZvciB4IGluIHhtbC5ldHJlZS5FbGVtZW50VHJlZS5wYXJzZSgnZmxlZXRfaW5wdXQueG1sJykuZmluZGFsbCgnQ2FyJyldCmRmID0gcGFuZGFzLkRhdGFGcmFtZS5mcm9tX2RpY3QoY2FyX2RldGFpbHMpCmRmLnRvX2NzdignZmxlZXRfb3V0cHV0LmNzdicsIGluZGV4PUZhbHNlKQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
import xml.etree.ElementTree
import pandas
car_details = [x.attrib for x in xml.etree.ElementTree.parse('fleet_input.xml').findall('Car')]
df = pandas.DataFrame.from_dict(car_details)
df.to_csv('fleet_output.csv', index=False)