Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Text CSV_XS memory crash

by glepore70 (Novice)
on Feb 02, 2011 at 15:57 UTC ( [id://885774]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Text CSV_XS memory crash
in thread Text CSV_XS memory crash

Hmm, I'm starting to see the light. I only need to work on one column at a time, read in the column, select min/max and distinct, then load the next column and repeat.

I'll go back to the drawing board, I think I'm pretty close...

Replies are listed 'Best First'.
Re^5: Text CSV_XS memory crash
by Anonyrnous Monk (Hermit) on Feb 02, 2011 at 16:18 UTC
    select min/max and distinct

    FWIW, things like min/max (and many other statistics) can also be computed sequentially (or incrementally), i.e. without storing all values in memory prior to starting the computations.  Maybe that's worth reconsidering...

Re^5: Text CSV_XS memory crash
by marto (Cardinal) on Feb 02, 2011 at 16:01 UTC

    Have you considered using DBD::CSV, or alternativly importing your data into a database of some sort?

      Using DBD::CSV will never be a valid option when reading a CSV file in full will cause memory hogs, as DBD::CSV will read the whole file into memory always. Nothing to prevent that. That means that the memory consumption for CSV files accessed with DBI might be up to double the size of the complete dataset as returned bi Text::CSV_XS->getline_all ().


      Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2025-03-18 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (56 votes). Check out past polls.