Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Complex file manipulation challenge

by haukex (Archbishop)
on Aug 13, 2019 at 18:01 UTC ( [id://11104404]=note: print w/replies, xml ) Need Help??


in reply to Re: Complex file manipulation challenge
in thread Complex file manipulation challenge

Nice! Note that the original problem statement includes this:

Note: Your program should work when files are much bigger than memory in your JVM and must close all open resources correctly
  • Comment on Re^2: Complex file manipulation challenge

Replies are listed 'Best First'.
Re^3: Complex file manipulation challenge
by Tux (Canon) on Aug 13, 2019 at 18:24 UTC

    I did not read the original problem statement :)

    csv (in => $fh, out => undef, on_in => sub { ... }); supports streaming and does not store in memory (other than the current record. Rewriting my version to do that can be an exercise to the reader.

    In preparation I found that PerlIO::via::gzip *only* supports open my $fh, ":via(gzip)", "file.gz"; and *not* open my $fh, ">", "file.gz"; binmode $fh, ":via(gzip)"; :( :(


    Enjoy, Have FUN! H.Merijn
      csv (in => $fh, out => undef, on_in => sub { ... }); supports streaming and does not store in memory

      Nice, good to know!

      I found that PerlIO::via::gzip *only* supports open my $fh, ":via(gzip)", "file.gz";

      Too bad, but IO::Compress::Gzip (core module) that I showed should support that AFAIK.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found