Help with file comparison

Hello, I am trying to compare 2 files and get only the new lines as output. Note that new lines can be anywhere in the file and not necessarily at the bottom of the file.

I have made the following progress so far.

/home/aa>cat old.txt
0001    732     A
0002    732     C
0005    732     D
0010    732     B
/home/aa>cat new.txt
0001    732     A
0002    732     AC
0003    801     A
0005    732     D
0006    908     Z
0010    732     B
0011    512     X
0012    732     Z
/home/aa>sdiff old.txt new.txt | egrep  '\\|>'          
> 0003    801     A
0010    732     B \ 0006    908     Z
> 0010    732     B
> 0011    512     X
> 0012    732     Z

Expected output

0003    801     A
0006    908     Z
0011    512     X
0012    732     Z

How do I do a cut to get the string after '> ' or '\ ' ?

Is there any easier way than using sdiff, grep and cut?
:wall:

Hi cartrider,

Could this be useful for you?

 $ cat new.txt | grep -v - -f old.txt
0002 732 AC                                                                                                                                                                                                                                  
0003 801 A                                                                                                                                                                                                                                   
0006 908 Z                                                                                                                                                                                                                                   
0011 512 X                                                                                                                                                                                                                                   
0012 732 Z

Regards,
Birei

Birei,
Thanks for the update. Note that the first line in your output is a 'Change' line. I am looking for only 'New' lines.
Also note the following error I am getting executing the same command as yours.

/home/aa>cat new.txt | grep -v - -f old.txt
grep: can't open -f
old.txt:0001    732     A
old.txt:0002    732     C
old.txt:0005    732     D
old.txt:0010    732     B

Thanks
cartrider

nawk 'FNR==NR{f1[$0];next} !($0 in f1)' old.txt new.txt

vgersh99,
Output should exclude line 0002 as this is a change line not a new line.

/home/aa>nawk 'FNR==NR{f1[$0];next} !($0 in f1)' old.txt new.txt
0002    732     AC
0003    801     A
0006    908     Z
0011    512     X
0012    732     Z

What's the key? The first field in both files?

nawk 'FNR==NR{f1[$1];next} !($1 in f1)' old.txt new.txt

vgresh99,

This is a very good solution when there is a key. I wonder if it is possible to get the expected output when there is no key.

Huh? I don't follow....
Could you try to restate what you're after.......