On Wed, Sep 04, 2002 at 10:20:36AM +0200, Van Den Abeele Kristof wrote:
> 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 ?

Try this approach. Sort the files using "sort" 
sort file1 > file1a
sort file2 > file2a
diff -y --suppress-common-lines file1a file2a|awk '{print $1}'|grep -v ">"



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

Reply via email to