Can I do this in awk? 
Author Message
 Can I do this in awk?

I've just started to learn my way around awk. I've browsed through a
few on-line tutorials, but I'm not sure how to do the following:
I want to read a list of output (text) files, have awk checks the
contents for each line for the occurrence of a specific string.. I know
how to do this, but what I don't know how to do is: once awk finds this
string, I need it to skip the following two lines, then print the
fourth record on the third line. Is this do-able using awk?
Your help is very much appreciated.

--M

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sat, 22 Dec 2001 03:00:00 GMT  
 Can I do this in awk?
Yes that should be easy enough.  Something like

/regular expression/ {
        getline # read line 2
        getline # read line 3
        get line        # read line 4
        print $0        # print line 4

Quote:
}

>I've just started to learn my way around awk. I've browsed through a
>few on-line tutorials, but I'm not sure how to do the following:
>I want to read a list of output (text) files, have awk checks the
>contents for each line for the occurrence of a specific string.. I know
>how to do this, but what I don't know how to do is: once awk finds this
>string, I need it to skip the following two lines, then print the
>fourth record on the third line. Is this do-able using awk?
>Your help is very much appreciated.

>--M

>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.



Sat, 22 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can this be done in AWK?

2. How is this done in awk/nawk/gawk?

3. Can this be done with AWK or ED ?

4. CA Cans VO ?

5. It's not bad canned meat...

6. It's not bad canned meat...

7. It's not bad canned meat...

8. Using CGI module with 'canned queries'

9. It's not bad canned meat...

10. Doing assembly and really doing assembly

11. Doing assembly and really doing assembly

12. common mistakes in awk: comparing awk with C

 

 
Powered by phpBB® Forum Software