Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do find and delete lines?

Status
Not open for further replies.

whatisthis987

IS-IT--Management
Apr 24, 2007
34
US
I have fileA consists of keywords:
aaa
bbb
ccc

And fileB consists of fulldata

I would like to the lines in fileB that contains any of the fileA keywords. For example,

line1 sdfffffffff
line2 sdfaaaaaaaa
line3 sdfghhrwwww

The output should be
line1 sdfffffffff
line3 sdfghhrwwww


Please help. Thanks.
 
Thanks Annihilannic. but the keywords that I tried to find has a space in between. Instead of "aaa", I'm actually looking for "aaa bbb" in the same line. How do i do this?
 
That should still work as long as they appear exactly the same in both files. Show me an example where it doesn't work?

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top