On Friday 25 August 2006 14:04, Mike wrote:
> On Fri, 25 Aug 2006, William O'Higgins Witteman might have said:
> > I have two files, one very long and the other much shorter.  Every line
> > in the short file is also in the long file.  What I need is a file with
> > every line in the long file *not* in the short file.  Is there an easy
> > way to have vim provide me with my desired complementary file?
> >
> > Thanks.
> > --
> >
> > yours,
> >
> > William
>
> $ man comm

Sorry for the nitpicking. But this sometimes might not work. For example

$cat temp1.txt
temp3
temp1

$cat temp2.txt
temp2
temp3
temp4
temp1
temp5

$comm -3 temp1.txt temp2.txt
        temp2
temp1
        temp4
        temp1
        temp5

$diff temp1.txt temp2.txt | grep '^>'  | cut -f 1 -d ' ' --complement
temp2
temp4
temp5

The OP did not mention that his files were sorted. So comm command might not 
be applicable for his case.

hth
raju

-- 
http://kamaraju.googlepages.com/cornell-bazaar
http://groups.google.com/group/cornell-bazaar/about

Reply via email to