Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: XML::CSV out of memory

by RonW (Parson)
on Mar 26, 2015 at 17:31 UTC ( [id://1121425]=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::CSV out of memory
in thread XML::CSV out of memory

do I even need Text::CSV for your suggestion? Couldn't the script just put $n lines of text into an array and feed those to @arr_of_data?

Text::CSV will insure you are reading complete records. If you can be sure that your input files have no embedded "new lines" in the CSV records, then you could skip Text::CSV.

And how would I do $csv_obj->print_xml("out.xml") at each iteration without clobbering the previous iteration?

Try (untested):

open(my $outFH, '>', "out.xml"); while (<>) { ...; $csv_obj->print_xml($outFH); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1121425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found