I understand how to open text files, and how to close them. But not use the bit inside so to speak.

Can any one give me a quick run down on how to edit code inside, and use an if statement to check if a string is equal to any of the data within the text file.