Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Extracting a file from .gz archive

by mwah (Hermit)
on May 14, 2008 at 10:28 UTC ( [id://686491]=note: print w/replies, xml ) Need Help??


in reply to Extracting a file from .gz archive

There's no .tar involved !?

BTW: in addition to the valueable links already given, you could simply invoke the Zlib-module from CPAN:

... use IO::Zlib; my $file = "IpToCountry.csv.gz"; my $end_file = "IpToCountry.csv"; my $fh = IO::Zlib->new($file, 'rb'); if(defined $fh) { open my $fd, '>', $end_file or die "$end_file $!"; while(my $line = <$fh>) { print $fd $line } undef $fh; } ...

This will extract the .csv.gz to a .csv

Regards

mwa

Replies are listed 'Best First'.
Re^2: Extracting a file from .gz archive
by jonnyfolk (Vicar) on May 14, 2008 at 12:55 UTC
    This solution did the job perfectly. Thank you for your help.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-23 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found