title: modifying a csv file creates unwanted duplicate output using seek(0) method
body: <p>I’m trying to make the following adjustments to my csv file.
  -   Action 1 - Insert a column and fill with a variable
  -   Action 2 - Delete first 32 rows of the file
  I’ve tried to reset the file position with seek() method to achieve this.</p>
  
  <p>When run, the csv file inserts my column variable via action 1.
  Action 2 appends a duplicate set of records less the 32 deletions with no column inserted.</p>
  
  <p>What I want is the 2 actions applied to the original dataset. I’m thinking seek) might not be what I need. What else should I consider? N.b. data files are small</p>
  
  <p>My Code;</p>
  
  <pre><code>with open(temp_filename, 'r', newline='') as inf, \
      open(local_filename, 'w', newline='') as outf:
      reader = csv.reader(inf)
      writer = csv.writer(outf)
      all = []
      row = next(reader)
  
  # insert column and fill
      for row in (reader):
          all.append([str(ASXCode)] + row)  
      writer.writerows(all)
  
      inf.seek(0)
  
  # delete first 32 rows 
      for _ in range(32):   # skip first 32 rows
          next(reader)      
      writer.writerows(reader)  # copy the rest
  </code></pre>