LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-14-2008, 11:01 PM   #1
jpgauvin
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


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
 
Old 12-15-2008, 03:57 AM   #2
radoulov
Member
 
Registered: Apr 2007
Location: Milano, Italia/Варна, България
Distribution: Ubuntu, Open SUSE
Posts: 212

Rep: Reputation: 35
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
 
  


Reply


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 12:36 PM.

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