Python Forum
parsing local xml files to csv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
parsing local xml files to csv
#1
hi,
I'm pretty new in Python.
ddi xml files available in the microdata service of the International Labour Organization.I downloaded these to my computer.
I want to parse these xml files with python and export to csv or excel.
Since the sample content is too long, I didn't copy it here.
I'm giving the linkhttps://www.ilo.org/surveydata/index.php...g/ddi/1357

How can I parse all xml tags?
How can I parse all the features.
I had a lot of attempts, but I wasn't successful.
I wanted to use namespace but it didn't happen.
result none always

Variable is defined in the last section of the same variable for more than one category of code to combine them into a single cell is possible to print

Example:
<var ID="V210" name="educ" files="F3" dcml="0" intrvl="discrete">
<location StartPos="25" EndPos="25" width="1" RecSegNo="1"/>
<labl>
Respondent education level
</labl>
<valrng>
<range UNITS="REAL" min="1" max="5"/>
</valrng>
<sumStat type="vald">
1000
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
1
</sumStat>
<sumStat type="max">
5
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>
completed primary or less
</labl>
<catStat type="freq">
662
</catStat>
</catgry>
<catgry>
<catValu>
2
</catValu>
<labl>
secondary
</labl>
<catStat type="freq">
291
</catStat>
</catgry>
<catgry>
<catValu>
3
</catValu>
<labl>
completed tertiary or more
</labl>
<catStat type="freq">
46
</catStat>
</catgry>
<catgry>
<catValu>
4
</catValu>
<labl>
(dk)
</labl>
<catStat type="freq">
0
</catStat>
</catgry>
<catgry>
<catValu>
5
</catValu>
<labl>
(rf)
</labl>
<catStat type="freq">
1
</catStat>
</catgry>
<varFormat type="numeric" schema="other"/>
</var>

Thank you in advance for your help
Reply


Messages In This Thread
parsing local xml files to csv - by erdem_ustunmu - Feb-23-2019, 11:30 AM
RE: parsing local xml files to csv - by snippsat - Feb-23-2019, 12:22 PM
RE: parsing local xml files to csv - by snippsat - Feb-23-2019, 10:41 PM
RE: parsing local xml files to csv - by snippsat - Feb-25-2019, 03:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  uploading files from a ubuntu local directory to Minio storage container dchilambo 0 518 Dec-22-2023, 07:17 AM
Last Post: dchilambo
  How to take the tar backup files form remote server to local server sivareddy 0 1,941 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  opening files and output of parsing leodavinci1990 4 2,606 Oct-12-2020, 06:52 AM
Last Post: bowlofred
  Parsing Xml files >3gb using lxml iterparse Prit_Modi 2 2,403 May-16-2020, 06:53 AM
Last Post: Prit_Modi
  Parsing Attached .MSG Files with Python3 ericl42 1 3,717 Apr-12-2019, 06:28 PM
Last Post: ericl42
  Fetching html files from local directories shiva 3 3,465 Mar-20-2018, 05:12 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020