How big is this file?  Is it necessary to keep it open for the whole loop iteration or can we just read it in at the beginning of the function and then iterate through the lines in a string?