File content comparison

Hi All
I want to do file comparison based on first field

 File1
1,A
2,B
3,C
4,E
File2
1,A
3,C
4,E
8,K

want to generate 3 different output as below
Entry in file1 but not in file2

O/p
2,B

Entry in file2 but not in file1

O/P
8,K

Common in both files

OP
1,A
3,C
4,E

Can anyone help

Did you consider the comm command with its selection parameters?

comm file[12]
		1,A
2,B
		3,C
		4,E
	8,K
1 Like

Yes i tried but same is not working
can you pls share nawk command for same

What "is not working"? Using the right options, I get exactly your desired output from it.