in reply to Comparing masses in two txt files

That sounds like a job for nested for loops.

What code have you got so far?