Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-14-2008, 11:01 PM   #1
LQ Newbie
Registered: Nov 2008
Location: Montreal
Distribution: RHEL 4, Fedora, CentOS, Ubuntu
Posts: 8

Rep: Reputation: 0
Question using awk on a awk result


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 ?


Old 12-15-2008, 03:57 AM   #2
Registered: Apr 2007
Location: Milano, Italia/Варна, България
Distribution: Ubuntu, Open SUSE
Posts: 212

Rep: Reputation: 36
No need to invoke awk more than once:

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
awk question on handling *.CSV "text fields" in awk jschiwal Programming 8 05-27-2010 06:23 AM
shell command using awk fields inside awk one71 Programming 6 06-26-2008 04:11 PM
Some comments on awk and awk scripts makyo Programming 4 03-02-2008 05:39 PM
awk kalyanofb Programming 4 02-19-2007 01:55 AM
cannot export result from awk into a variable in a bash script Emmanuel_uk Linux - Newbie 4 03-07-2005 01:54 AM

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration