title: Edit and/or Delete a row on CSV file
body: <p>I have a CSV file. I need to write a code that we can get a row from CSV by username. And I need to either update or delete that row from the CSV file. I was managed to get the row data by username. But I haven't got any idea how to write the code for Update or delete function. My code to get single row as follows</p>
  
  <pre><code>  StreamReader reader = new StreamReader(System.IO.File.OpenRead(@"C:\Test\test.CSV"));
  
          UserDetailsViewModel objInput = new UserDetailsViewModel();
  
          while (!reader.EndOfStream)
          {
              string line = reader.ReadLine();
              if (!String.IsNullOrWhiteSpace(line))
              {
                  string[] values = line.Split(',');
                  if (values[0] == "Bharat")
                  {
                      objInput.FirstName = values[0];
                      objInput.LastName = values[1];
                      objInput.Address1 = values[2];
                      objInput.Address2 = values[3];
                      objInput.City = values[4];
                      objInput.State = values[5];
                      objInput.ZipCode = values[6];
                      break;
  
                  }
              }
          }
          reader.Dispose();
          return View(objInput);
  </code></pre>
  
  <p>Please someone help me to write a code for Update and delete on CSV file.</p>
  
  <p>Thanks in Advance.</p>