Validating the content of a file

I want to load a file and make some validations in this file, but i don’t know how, can help me ?