Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-01-20 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (227 votes). Check out past polls.

    Notices?