Converting XML to CSV

M

Mark Drummond

I have an application, Garmin Training Centre, which logs exercise data
from my Garmin GPS/HRM. While the Training Centre provides all kinds of
get data analysis, it does not do everything I like. I would like to be
able to pull my exercise data into a spreadsheet or even a database
where I can do more analysis.

The Training Center software allows me to export my data, but only in an
XML format. I started writing a script to convert this to a CSV but I am
wondering if using something like XML-Parser would make my life easier.
I haven't done any work with XML files before.

Any suggestions?

Mark
 
J

J. Gleixner

Mark Drummond wrote:
[...]
to export my data, but only in an
XML format. I started writing a script to convert this to a CSV but I am
wondering if using something like XML-Parser would make my life easier.
I haven't done any work with XML files before.

Any suggestions?

Your first step would be to search CPAN (http://search.cpan.org/_
for possible modules.

Put in "XML CSV" and you'll find XML::CSV.

Could also look at XML::Simple, to parse the XML into a data
structure.
 
D

DJ Stunks

Mark said:
I have an application, Garmin Training Centre, which logs exercise data
from my Garmin GPS/HRM. While the Training Centre provides all kinds of
get data analysis, it does not do everything I like. I would like to be
able to pull my exercise data into a spreadsheet or even a database
where I can do more analysis.

The Training Center software allows me to export my data, but only in an
XML format. I started writing a script to convert this to a CSV but I am
wondering if using something like XML-Parser would make my life easier.
I haven't done any work with XML files before.

Any suggestions?

Someone else asked this exact question earlier this week and I'll tell
you what I told him - just open the .xml in Excel 2003 and save it as a
..csv or .xls or whatever you like.

I love Perl, but if your spec is really this simple there's no need to
wield the big hammer...

-jp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top