[Techtalk] finding added lines in a file

Little Girl littlergirl at gmail.com
Fri Aug 16 04:24:20 UTC 2013


Hey there,

Miriam English wrote:

> Anybody know the secret?

Five more for you, and I added them to the original three, so here's
the full list (so far!):

awk 'NR==FNR{a[$0];next} !($0 in a)' A.txt B.txt

comm -1 -3 <(sort A.txt) <(sort B.txt)

diff A.txt B.txt |grep -A 1 ">" | cut -c 3-

grep -v -f A.txt B.txt

grep -vxF -f A.txt B.txt

join -v 2 <(sort A.txt) <(sort B.txt)

sort A.txt B.txt A.txt | uniq -u

sort A.txt A.txt B.txt | uniq -c | awk '{ if ($1 == 1) { $1 = ""; print; } }' | cut -c 2-

-- 
Little Girl

There is no spoon.


More information about the Techtalk mailing list