01.txt
>SR1.2
>SR1.3
02.txt
>SR1.1 HWI-ST
"if the first line and the first column are the same"
Your first line and the first column arent the same. Thats the problem to begin with, clearly the line you are trying to match is not on the first line of file 2.