LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-02-2007, 09:36 PM   #1
hepburnenthorpe
Member
 
Registered: Jun 2006
Location: Sydney
Distribution: Gentoo + Debian
Posts: 132

Rep: Reputation: 15
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?
 
Old 04-02-2007, 11:07 PM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I can't get my head in it, never mind around it!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Random file lines directed to a new file. In script an error. In command line no err leventis Programming 1 09-28-2006 08:16 AM
How To Trim A File fpfernando Programming 11 01-05-2006 09:04 AM
Unique lines based on specific fields. carl.waldbieser Programming 6 08-21-2005 03:26 PM
vim: mark end-of-line? trim blank lines? prell Linux - Software 3 09-21-2004 12:04 AM
delete some lines from a file freelinuxcpp Linux - Software 4 01-17-2004 11:28 AM


All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration