zcat output

Discussion in 'Perl' started by Me, Dec 28, 2004.

  1. Me

    Me Guest

    How can I get the output from 'zcat' as if I was opening a file? What I
    would like to do, is go throug each line return by zcat looking for
    specic patterns.

    Thanks,
    Newbie
     
    Me, Dec 28, 2004
    #1
    1. Advertising

  2. Me

    Jim Gibson Guest

    In article <>, Me <>
    wrote:

    > How can I get the output from 'zcat' as if I was opening a file? What I
    > would like to do, is go throug each line return by zcat looking for
    > specic patterns.


    open( $z, 'zcat file.gz|' ) or die("Can't open file.gz: $!");
    while( <$z> ) {
    if( /pattern/ ) {
    #do something
    }
    }

    You should also check out the IO::Zlib module on CPAN.

    FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.


    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
     
    Jim Gibson, Dec 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bentley

    Output / Debug window output bug?

    John Bentley, Sep 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    599
    John Bentley
    Sep 10, 2003
  2. chuck amadi
    Replies:
    1
    Views:
    499
    Larry Bates
    Jun 23, 2004
  3. Paul
    Replies:
    1
    Views:
    435
  4. David G. Andersen

    Speed gap between zcat and zlib's GzipReader

    David G. Andersen, Oct 19, 2004, in forum: Ruby
    Replies:
    3
    Views:
    480
    Yukihiro Matsumoto
    Oct 26, 2004
  5. music

    unix zcat with ruby?

    music, Apr 23, 2007, in forum: Ruby
    Replies:
    13
    Views:
    237
    Robert Dober
    Apr 24, 2007
Loading...

Share This Page