Compare 2 files which are not look alike

Hi,

I have 2 files as seen below.

File 1:

apple#fruit
carrot#vege
orange#fruit

File 2:

#list of fruits

fruitlist
:
apple#fruit
grape#fruit
orange#fruit

finish

#list of veges

vegelist
:
brinji#vege
beetroot#vege

finish

Now i need to compare these 2 files and take out the difference from file1. So my output will be

 carrot#vege

Need advise on this.

If you are looking for those records on file1 that are not on file2, then use this. Note files should be sorted.

comm -23 File1 File2 
bash:carlo$ join -v 1 <(sort 1.txt) <(sort 2.txt)
carrot#vege

That worked !!!!!!!!!! Thanks much for the replies :slight_smile: