open the file while there are more lines, get a line if the line matches certain strings do something with it close the file