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 Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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-11-2008 03:56 AM
port filtering ujjwalmohan HP-UX 0 11-26-2007 01:18 AM
Filtering Data bobo UNIX for Dummies Questions & Answers 2 09-19-2007 04:06 PM
Filtering Data Raynon Shell Programming and Scripting 7 09-05-2007 07:38 PM
Need help in string filtering (KSH) rockysfr Shell Programming and Scripting 1 06-28-2007 03:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-14-2007
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
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
  #2 (permalink)  
Old 09-14-2007
awk awk is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 134
grep ^ABC$
  #3 (permalink)  
Old 09-14-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958

Code:
awk '/^pattern$/ { print }' filename

  #4 (permalink)  
Old 09-17-2007
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
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
  #5 (permalink)  
Old 09-17-2007
varungupta varungupta is offline
Registered User
  
 

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


Thanks to all...I got the solution !!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0