The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grep question. saurabhsinha23 UNIX for Dummies Questions & Answers 3 12-10-2007 10:58 PM
grep question tim-bobby UNIX for Dummies Questions & Answers 4 10-05-2007 08:58 AM
Another grep question kingdbag UNIX for Dummies Questions & Answers 6 10-26-2006 10:56 PM
grep & sed question der Kopf Shell Programming and Scripting 1 11-22-2004 01:49 AM
Grep question eloquent99 UNIX for Dummies Questions & Answers 4 02-20-2003 07:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-22-2007
Registered User
 

Join Date: Mar 2007
Posts: 20
Question about GREP

I have 2 files, in one file is a list of hex numbers, the other is what i need matched. Is it possible for me to specify to grep the list and have it go through the second file for each item in the list in the first file to match the lines? so this is like a cross-refference.
Reply With Quote
Forum Sponsor
  #2  
Old 03-22-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Code:
grep -f file_with_hex_list file_to_be_matched
Reply With Quote
  #3  
Old 03-22-2007
Registered User
 

Join Date: Mar 2007
Posts: 20
wow, thank you for the fast reply - i was looing all over the internet for how to do that with no avail.
Reply With Quote
  #4  
Old 03-22-2007
Registered User
 

Join Date: Mar 2007
Posts: 20
Quote:
Originally Posted by anbu23
Code:
grep -f file_with_hex_list file_to_be_matched

is that the exact command? say "hexlist" is the list file and "searchlist" is the search file, i typed:

Code:
grep -f hexlist searchlist > results
all it did was copy searchlist to results.
Reply With Quote
  #5  
Old 03-22-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
check out this link!
Reply With Quote
  #6  
Old 03-22-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Then all the lines in searchlist file should contain any one of hex numbers in hexlist file.
Reply With Quote
  #7  
Old 03-22-2007
Registered User
 

Join Date: Mar 2007
Posts: 20
Quote:
Originally Posted by anbu23
Then all the lines in searchlist file should contain any one of hex numbers in hexlist file.
no - the whole file does not match the list.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:08 AM.


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

Content Relevant URLs by vBSEO 3.2.0