On Fri, 13 Jul 2007 08:18, Peter B. Steiger wrote:
> Suppose file A has:
> AAA
> BBB
> DUPLICATE
> CCC
>
> and file B has
> 111
> DUPLICATE
> 222
> 333
>
> I'd like to combine the two files without changing the order of the
> lines AND without including duplicate lines, so the end result might be
> something like this:
> 111
> DUPLICATE
> 222
> 333
> AAA
> BBB
> CCC
>
Did you try grep -v -f

Something like this :
grep -f file1.txt -v file2.txt > file2a.txt && cat file1.txt file2a.txt

seems to work for your trivial example.

Regards

Tony Sauri

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to