Search for patterns in text files