title: CSV search and replace a specific row or column
body: <p>I was searching for a while without any Solutions for my Problem.
  I hope someone could help me out a Little bit.
  First of all, I am a beginner with pyhton.(3.7)</p>
  
  <p>My Programm should do:
  A customer comes to the Company and gets registered with Name,mail and an ID(=1)
  if the customer exists already the ID should Count to 10 (ID+1)</p>
  
  <p>so far it works that the customer gets added to the csv.
  Missing is the part, when the customer is already in the csv.
  I know that the ID is always in the same column, so i just want to replace the ID in the csv.
  the CSV Looks smth like this:
  Surname, Name, mail,telephonenr., ID
  Max, Mustermann, max@test.com,000,1</p>
  
  <pre><code>    def button_action():
  Vorname = eingabe_vorname.get()
  Nachname = eingabe_nachname.get()
  mail = eingabe_mail.get()
  tel = eingabe_tel.get()
  #ID = 1
  if (Vorname == "" or Nachname == "" or mail == ""):
  namen_label.config(text="Bitte fülle alle Felder aus.")
  else:
  infos=(Vorname,Nachname,mail,tel,ID)
  #checks if the name is already knwown
  #counts purchases until 10th, than resets the counter
  with open('C:\\temp\\csv.csv') as csvfile:
  list = csv.reader(csvfile,delimiter=",")
  for row in list:
  if(len(row) &gt; 4):
  if (Vorname ==row[0] and Nachname == row[1] and mail == row[2] and tel == row[3]):
  namen_label.config(text='vorhanden')
  einkauf = int(row[4])
  if einkauf &lt;9:
  einkauf_neu = einkauf + 1
  namen_label.config(text=('Kunde bereits vorhanden, bereits der ',einkauf_neu,' Einkauf'))
  else:
  namen_label.config(text='Bereits der 10 Einkauf,gratis gift')
  einkauf_neu = 0
  new_entry = (Vorname,Nachname,mail,tel,einkauf_neu)
  #overwrite of theID 
  with open ('C:\\temp\\csv1.csv','w') as output_exist:
  writeexist = csv.writer(output_exist)
  writeexist.writerow(new_entry)#where? I want to write in the same column where the name isI tried to finish it on my own but i struggle with the replace of the ID
  </code></pre>
  
  <p>I would like to accomplish it without any extra modul like Pandas or smth like that.</p>
  
  <p>If someone has a tipp for me it would be great.</p>