I have a forEach where I read and write data to a file, (don\'t want to change that to write all at once) but it\'s only writing the last loop, and before then it doesn\'t w