(Sep-09-2020, 06:30 AM)bowlofred Wrote: Then on line 56 you write that data out. But you do so by opening (and overwriting) any data that exists.That is not the cause of their problem - they open the file in append mode.
The problem is in the loop on lines 37-51. You virtually loop over the file and read each line, every time replacing
h
before you have written it to a file. So, only the last row of the source file is written. You either need to move the part where you write (lines 53-58) inside loop or create a list of dicts and then write all of them in one go using csv.DictWriter.writerows()
method
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs