

So, what have you tried? Showing code, with a good description of what you're trying to do (nicely done, above) and what you're getting that's different gets pretty fast answers around here, most of the time. You can probably get by with focusing on the XML::LibXML::Node and XML::LibXML::Element docs.Īnd before you get too far- have you profiled your code at all to see where the hangups are? Is it the SQL being super slow because you don't have it indexed on the right columns and while the perl might turn the CSV into XML in a second or two, you're going to spend 3 days exporting the SQL to CSV in the sorted format you show here?


You should be able to use Text::CSV and XML::LibXML to do something that runs pretty fast. I'm too lazy right now to sort through your XML to figure out exactly how you want to do the structure- rather than just turning each line into an XML record it looks like you want a bunch of nested loops following the columns almost from left to right, and terminating each loop when there's a change in the value. Re: Convert CSV file to XML file using Perl?
