Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: need to extract top and bottom lines...

by zejames (Hermit)
on Dec 14, 2004 at 19:56 UTC ( #414834=note: print w/replies, xml ) Need Help??


in reply to need to extract top and bottom lines...

How about
my $previous; open F, "< /tmp/log.diff" or die "Unable to open file : $!\n"; while (<F>) { chomp; if (m/ERROR/) { print CSVFILE, "$previous\n$_\n"; } $previous = $_; }

--
zejames

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-10-20 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (209 votes). Check out past polls.

    Notices?