Sep-09-2020, 06:30 AM
At line43, you create a datastructure for the currently read line. Then on line 56 you write that data out. But you do so by opening (and overwriting) any data that exists. So only the last line is visible. You don't want to open the output file within the per-line loop.