Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Finding and extracting lines of text

by Cine (Friar)
on Jul 29, 2003 at 20:35 UTC ( [id://278977]=note: print w/replies, xml ) Need Help??


in reply to Finding and extracting lines of text

That seems ok, except that you are skipping the first line.
Btw. You should print the error message when you have problems opening a file, as in die "Could not open filename: $!";

T I M T O W T D I

Replies are listed 'Best First'.
Re: Re: Finding and extracting lines of text
by Anonymous Monk on Jul 29, 2003 at 21:45 UTC
    Thanks Tim, It is good to know I am heading in the right direction, but as I said it does not work. The script completes, ut it does NOT print the line. Then on to the next step, How do I skip the next 2 lines and print the 3rd line from where I "found" the test expression? Thanks again.
      If its just for you and not for processing, then perl is overdoing it and grep -A3 "line searching for" file.log is much easiere.
      Else you have to make a little state machine to handle the cases properly (as in before found, searching for lines between, printing the next info and searching for the next data)

      T I M T O W T D I

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://278977]
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: (2)
As of 2024-04-26 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found