work right to read file and check the pattern