If you're willing to sort the files first, the 'comm' command will do
what you want.

To get the lines unique to file1 in file3 use the following:

        comm -23 file1 file2 > file3


Juan


On Wed, 4 Sep 2002, Van Den Abeele Kristof wrote:

> Date: Wed, 4 Sep 2002 10:20:36 +0200
> From: Van Den Abeele Kristof <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Agian , some compare problems
>
> Hello list ,
>
>
> Thx for answering my little 'diff' problem , but I still need some help...
>
>
> I have 2 files (ex.):
>
> file 1                file 2
>
> word u                word t
> word v                word v
> word w                word z
> word x                word a
> word y
> word z
>
>
> I wish to compare those 2 files , and create as output file 3 which consist of the 
>words in file 1 which are NOT in file 2.
> In other words , all words which exist in file 2 should be removed from file 1
>
>
> so file 3 should be :
>
> word u
> word w
> word x
> word y
>
>
> Could this be done at command line with some simple instructions , or should I 
>create a small script ?
>
> Greetingz & thx for the reply's ...
>
> Kristof



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to