Python Programming (XMLto CSV) I\'m looking for a code using python. All two bel
ID: 3707707 • Letter: P
Question
Python Programming (XMLto CSV) I'm looking for a code using python. All two below sample XML files convert to CSV in one single code. Its pretty urgent.
File 1:
<?xml version="1.0" encoding="utf-8"?>
<tags>
<row Id="1" TagName="unix" Count="9" ExcerptPostId="1903" WikiPostId="1902"/>
<row Id="2" TagName="storage" Count="235" ExcerptPostId="373107" WikiPostId="373106"/>
<row Id="30" TagName="size" Count="144"/>
File 2:
<?xml version="1.0" encoding="utf-8"?>
<badges>
<row Id="1" UserId="2" Name="Autobiographer" Date="2010-08-10T19:15:06.497" Class="3" TagBased="False" />
<row Id="2" UserId="3" Name="Autobiographer" Date="2010-08-10T19:15:06.513" Class="3" TagBased="False" />
Explanation / Answer
Here is a python code to parse above two xml types into one csv
run it like this
$ python xmltocsv.py file1.xml file2.xml
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.