Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Extracting a file from .gz archive

by mwah (Hermit)
on May 14, 2008 at 10:28 UTC ( #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
Node Status?
node history
Node Type: note [id://686491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2021-04-10 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?