EDIT The approved answer is correct and all of my data appears in the file, however since it is looping …