Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: Convert CSV file to XML file using Perl?

by bitingduck (Chaplain)
on Jul 05, 2015 at 05:45 UTC ( #1133228=note: print w/replies, xml ) Need Help??

in reply to Re^3: Convert CSV file to XML file using Perl?
in thread Convert CSV file to XML file using Perl?

Assuming that your dump to CSV is ordered like you showed in the original post, I'd probably go with dump to CSV and then write some perl to read the CSV line by line and build up the XML using XML::LibXML. Perl is pretty quick at that sort of stuff. I have some code that's all perl calling MySQL and for stuff that's a few thousand records it generates a bunch of HTML files (not too different from building up XML) plus separate text audit files by the time I've lifted my finger off the return key. For stuff that's reading a few thousand lines of CSV and doing inserts into a database of millions of lines (including some lookups to decide how to cross reference things) it takes a few minutes.

  • Comment on Re^4: Convert CSV file to XML file using Perl?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1133228]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2018-07-22 05:28 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (451 votes). Check out past polls.