Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Converting XML to CSV

Reply
Thread Tools

Converting XML to CSV

 
 
Mark Drummond
Guest
Posts: n/a
 
      06-08-2006
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
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      06-08-2006
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.
 
Reply With Quote
 
 
 
 
DJ Stunks
Guest
Posts: n/a
 
      06-08-2006

Mark Drummond wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
read and write csv file using csv module jliu66 Python 0 10-19-2007 03:12 PM
How to move data from a CSV file to a JTable, and from a JTable to a CSV file ? Tintin92 Java 1 02-14-2007 06:51 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Re: csv writerow creates double spaced excel csv files Skip Montanaro Python 0 02-13-2004 08:50 PM
csv writerow creates double spaced excel csv files Michal Mikolajczyk Python 0 02-13-2004 08:38 PM



Advertisments