Loading a number from a .txt file

How can I load a number from a .txt file ? I want to verify if that number is equal to another variable. For example my variable is 4, and the number in the text file is 5. How can I verify if they are eqal or not? I suppose I have to load that number into another variable, but I don’t know how. I would really appreciate some help. Hope I was clear enough.
Thanks in advance.