Find uncommon in one file from data in another file

Hello,

I have 2 files.

File A and File B
File A has below data
2000328288038 02 <-- its 02
2000292181441 11
2000292181441 11
2000000073963 25
2000075097222 22
File B has below data
2000328288038,2,1234 <-- 2 (it should also be taken care)
2000292181441,11,1233
2000000073963,14,12345
2000075097111,25,8768
output should be in one file like below
2000000073963,25
2000075097111,25

output should be in another file like below

2000328288038,22
2000292181441,11

In file A some data is twice it should remove duplicate first, and the search record of file A in file File B(both the column in files should match ),
If Data in File A is present in File B should save it in one file and
If Data in File A is not present in File B should save it in another file and (search should consider both the columns)
Because 1st column will be present in both the files but second column will be different for many

Assuming your files are f1 and f2:

To print lines present in both the files:

comm  -12 <(sort -u f1) <(sort -u f2)

To print lines present in f1, but not present in f2:

comm  -23 <(sort -u f1) <(sort -u f2)

Guru.

Guru

But in file 2 I have data with few more columns, will that be a problem ?

41236626,000,2000317996245,7