Getting count of Key in another file

Hi All,

I need to find the count of key occurrence from one file corresponding to another file. Any help please. I am planning to read the CUST_ID in a while loop and do a grep , is there a way to do easier

CUST_ID
677582806078
687582821181
687582828910
687582834580
687582834849
687582836290
687582838298
687582838925
687582838926
687582839317

TRANSACTION
2002;20140630;0000;0002000000;1109500248;677582806078;0.00
2002;20140630;0000;0002000000;1109500248;677582806078;0.00
2002;20140630;0000;0002000000;1109500248;91227510334;0.00
2002;20140630;0000;0002000000;1109500248;91227810199;0.00
2002;20140630;0000;0002000000;1109500248;91277010605;0.00
2002;20140704;0000;0002000000;1109500248;639867328;0.00
2002;20140704;0000;0002000000;1109500248;1700306519;0.00
2002;20140704;0000;0002000000;1109500248;687582838926;0.00
2002;20140704;0000;0002000000;1109500248;687582838926;2.98
2002;20140704;0000;0002000000;1109500248;687582834580;2.99

OUTPUT
677582806078 ---> 2
687582838926 ---> 2
687582834580 ---> 1

Hi, try:

awk 'NR==FNR{C[$6]++; next} $1 in C{print $1, C[$1]}' FS=\; file2 FS=" " file1
1 Like