LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   using awk on a awk result (http://www.linuxquestions.org/questions/programming-9/using-awk-on-a-awk-result-690620/)

jpgauvin 12-14-2008 11:01 PM

using awk on a awk result
 
Hello

I need to parse the Apache Log and
I'm having some problem using awk on an awk result

I want to do an awk BEGIN {FS="\""} {print $1} then an awk BEGIN {FS=" "} {print $1} on the result

does somebody know a good way to do it ?

Thanks

Jean-Philippe

radoulov 12-15-2008 03:57 AM

No need to invoke awk more than once:

Code:

$ print 'a b"c d"e'|awk -F\" '{split($1,t,OFS);print t[1]}'
a



All times are GMT -5. The time now is 01:51 AM.