You've got some code with issues. It's great that you have provided some example input and output. I'm having trouble understanding the algorithm between "match" and "no match". Can you explain further with some text? Then I can comment further on the code.
B from FILE1 with number 1_3 and B from FILE2 with number 2_2 match What is it that "matches".