in reply to Check multiple lines exist in a record
See How do I read an entire file into a string?. You might also consider applying consistent indentation to your code.