Each record should be split into the label and the rest
Make the label the hash key and the rest the hash value
Close file1 and open file2 and read it in one record at a time
Each record should be split into the label and the rest
You now have two rows to compare (the current record from file2 and the one stored in the hash keyed on the label from file1), so do that for whatever "compare" means in your task