The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Opt out selection drhowarddrfine Post Here to Contact Site Administrators and Moderators 5 01-23-2008 10:20 PM
combining fields in two text fields shocker Shell Programming and Scripting 3 01-16-2008 07:27 AM
tray selection amit kul UNIX for Advanced & Expert Users 3 07-16-2007 05:31 AM
Array and Selection ZINGARO Shell Programming and Scripting 4 07-15-2007 05:11 PM
Character selection script Ypnos Shell Programming and Scripting 2 11-20-2003 09:08 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: May 2008
Posts: 53
awk selection on fields

I want to have a search using the month and year to output numerical data.

The knowledge i have so far on the matter is:

$awk '{print $1, $2, $3, $4 }' hits


the result of this is:

123.45.6.7 NOV 2006 1805GMT

now for me this code will print out the two colums i want but i need to figure out a way to create the search criteria for these columns.

the search criteria needs to be the month and date and needs to be entered either numerically or with text.

any ideas?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-09-2008
Moderator
 

Join Date: Feb 2007
Posts: 1,561
An example how you can get the records of "nov 2006"

Code:
awk '$2=="NOV" && $3=="2006" {print $1, $2, $3, $4 }' hits
Regards
Reply With Quote
  #3 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: May 2008
Posts: 53
thanks very much. i shall try it out

you have no idea how much you have helped me out. considering i myself, am complete an utter amatuer at this.. (first time user in other words)
Reply With Quote
  #4 (permalink)  
Old 05-12-2008
Registered User
 

Join Date: May 2008
Posts: 53
************** Thread Closed **********************
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0