LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trim lines based on other file. (https://www.linuxquestions.org/questions/linux-newbie-8/trim-lines-based-on-other-file-542818/)

hepburnenthorpe 04-02-2007 08:36 PM

trim lines based on other file.
 
I have 4 files.

master
Code:

a
b
c
d
e
f


p1
Code:

a
c
d

p2
Code:

b
c
e

p3
Code:

a
b

What I need to do is remove all lines from master excepting those that do NOT occur within any of the other three files (p1,p2,p3). So in this case master would end up with...

master
Code:

f
Ive tried numerous combinations of looping the the different files but just can't get my head around it.

Can anyone give me a hand?

Junior Hacker 04-02-2007 10:07 PM

I can't get my head in it, never mind around it!


All times are GMT -5. The time now is 03:23 AM.