The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk and sed filtering invinzin21 Shell Programming and Scripting 2 01-10-2008 11:56 PM
port filtering ujjwalmohan HP-UX 0 11-25-2007 09:18 PM
Filtering Data bobo UNIX for Dummies Questions & Answers 2 09-19-2007 12:06 PM
Filtering Data Raynon Shell Programming and Scripting 7 09-05-2007 03:38 PM
Need help in string filtering (KSH) rockysfr Shell Programming and Scripting 1 06-27-2007 11:04 PM

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

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Exclamation awk filtering ?

I have a Ques. Regarding awk

I have few strings in a file, like..

ABC
DEF_ABC
GHI_ABC
GHI

Now I want string which has only 'ABC', not the part of any other string as it is also present in 'DEF_ABC'

Output should be ABC

Please guide me asap !!

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-14-2007
awk awk is offline
Registered User
 

Join Date: Feb 2007
Posts: 114
grep ^ABC$
Reply With Quote
  #3 (permalink)  
Old 09-14-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,491
Code:
awk '/^pattern$/ { print }' filename
Reply With Quote
  #4 (permalink)  
Old 09-16-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Question

Quote:
Originally Posted by matrixmadhan View Post
Code:
awk '/^pattern$/ { print }' filename
Hey,

I'll describe the Problem in more explainatory manner now...

I have..

AUDIT_QUEUE
SOF_AUDIT_QUEUE
FAILURE_QUEUE
EXCEPTION_QUEUE
EXCEPTION_AUDIT_QUEUE


NOW..i want the o/p AUDIT_QUEUE only, as AUDIT_QUEUE is part of another two strings how can i ignore those strings. {using awk and grep }

Give me the solutions plz.
Thanks
Reply With Quote
  #5 (permalink)  
Old 09-16-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Thumbs up


Thanks to all...I got the solution !!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:48 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