comparing multiple files

hi, quick question i have one file which join one file with reference one
Looks like this:
KB0000 KB207418
KB0001 KB244904
KB0002 KB215027
KB0003 KB215027
KB0004 KB215027
KB0005 KB204320
KB0006 KB207074
KB0007 KB215204
KB0008 KB223809
KB0009 KB236640
KB0010 KB244506
....
Then i have all these files, which should be compared pairwise and the difference, if any should be printed, The files looks like this:
>KB0000 1658 amino acids
#
#
#
# Sequence # x Context Score Kinase Answer
# -------------------------------------------------------------------
# KB0000 10 S RRWASGSRG 0.978 unsp YES
# KB0000 10 S RRWASGSRG 0.637 PKA YES
# KB0000 10 S RRWASGSRG 0.528 RSK YES
# KB0000 10 S RRWASGSRG 0.519 cdc2 YES
# KB0000 10 S RRWASGSRG 0.468 CaM-II .
# KB0000 10 S RRWASGSRG 0.441 GSK3 .
# KB0000 10 S RRWASGSRG 0.416 DNAPK .
# KB0000 10 S RRWASGSRG 0.359 CKI YES
# KB0000 10 S RRWASGSRG 0.356 PKG .
# KB0000 10 S RRWASGSRG 0.281 p38MAPK .
# KB0000 10 S RRWASGSRG 0.252 ATM .
# KB0000 10 S RRWASGSRG 0.232 PKC .
# KB0000 10 S RRWASGSRG 0.223 CKII .
# KB0000 10 S RRWASGSRG 0.168 cdk5 .
# KB0000 10 S RRWASGSRG 0.147 PKB .
#
# KB0000 12 S WASGSRGAA 0.757 PKC YES

>KB207418 1658 amino acids
#
#
# Sequence # x Context Score Kinase Answer
# -------------------------------------------------------------------
# KB207418 10 S RRWASGSRG 0.978 unsp YES
# KB207418 10 S RRWASGSRG 0.637 PKA YES
# KB207418 10 S RRWASGSRG 0.528 RSK YES
# KB207418 10 S RRWASGSRG 0.519 cdc2 YES
# KB207418 10 S RRWASGSRG 0.468 CaM-II .
# KB207418 10 S RRWASGSRG 0.441 GSK3 .
# KB207418 10 S RRWASGSRG 0.416 DNAPK .
# KB207418 10 S RRWASGSRG 0.359 CKI .
# KB207418 10 S RRWASGSRG 0.356 PKG .
# KB207418 10 S RRWASGSRG 0.281 p38MAPK .
# KB207418 10 S RRWASGSRG 0.252 ATM .
# KB207418 10 S RRWASGSRG 0.232 PKC .
# KB207418 10 S RRWASGSRG 0.223 CKII .
# KB207418 10 S RRWASGSRG 0.168 cdk5 .
# KB207418 10 S RRWASGSRG 0.147 PKB .
#
# KB207418 12 S WASGSRGAA 0.757 PKC YES

so in this case the output should be
# KB0000 10 S RRWASGSRG 0.359 CKI YES

Thx in advance for the help :slight_smile:

Try grep with the options -f and -v. Check the man page for more details.

Regards

The problem is that those files has different names, and also the first column differs for every row.. How to overcome that?