in reply to comparing overlap?

I think it would help if you create examples of each of your six cases. As described, I've no idea what you want to do. (And really, having a "file 1" different from a "first file" doesn't do wonders for understanding your problem either).