title: Writing into csv file display blank, using csvhelper
body: <p>Guys am trying to read a csv file from the view, get its data , format it and write back into an empty csv file. presently have been able to achieve the first approach, where the challenge is right now is writing back into an empty csv file created , but it happens that the csv file is always blank after writing in the file. can someone help me out if am missing anything. Note " am just reading and writing the field , have got nothing to do with the hearder because the csv file has no header" Am using csvhelper library.   </p>
  
  <pre><code>        if (file.ContentLength &gt; 0)
          {
  
              string origin = "FORMATERCSV";
  
              string destination = "FORMATERCSVDESTINATION";
              string curretnDate = Convert.ToString(DateTime.Now.ToShortDateString().Replace(@"/", "_"));
              var fileName = Path.GetFileName(file.FileName);
  
              var pathfound = Server.MapPath( @"/" + "Content" + "/" + origin + "/" +  curretnDate + "/");
              var pathfoundDestination  = Server.MapPath(@"/" + "Content" + "/" + destination + "/" + curretnDate + "/");
              if (!Directory.Exists(pathfound)) Directory.CreateDirectory(pathfound);
  
              if (!Directory.Exists(pathfoundDestination)) Directory.CreateDirectory(pathfoundDestination);
  
  
  
              string PathToStore = string.Format(@"{0}\{1}", pathfound, fileName);
  
              string PathToStoreDestination = string.Format(@"{0}\{1}", pathfoundDestination, fileName);
              var path = Path.Combine(pathfound,fileName);
              file.SaveAs(PathToStore);
  
              file.SaveAs(PathToStoreDestination);
              System.IO.File.WriteAllText(PathToStoreDestination,string.Empty);
  
  
  
              StreamReader sr = new StreamReader(PathToStore);
  
  
              CsvReader csvread = new CsvReader(sr);
  
              csvread.Read();
  
              var shedule = new Shedule()
              {
                  RSA_PIN = csvread.GetField&lt;string&gt;(0),
                  EMPLOYEE_NAME = csvread.GetField&lt;string&gt;(1),
                  EMPLOYER_CONTRIBUTION = csvread.GetField&lt;double&gt;(2),
                  EMPLOYER_VC = csvread.GetField&lt;double&gt;(3),
                  EMPLOYEE_CONTRIBUTION = csvread.GetField&lt;double&gt;(4),
                  EMPLOYEE_VC = csvread.GetField&lt;double&gt;(5),
                  TOTAL_CONTRIBUTION = csvread.GetField&lt;double&gt;(6),
                  FROM_MONTH = csvread.GetField&lt;string&gt;(7),
                  FROM_YEAR = csvread.GetField&lt;string&gt;(8),
                  TO_MONTH = csvread.GetField&lt;string&gt;(9),
                  TO_YEAR = csvread.GetField&lt;string&gt;(10),
                  EMPLOYER_CODE = csvread.GetField&lt;string&gt;(11),
                  EMPLOYER_NAME = csvread.GetField&lt;string&gt;(12),
                  PTID = csvread.GetField&lt;string&gt;(13),
                  RECEIVED_DATE = csvread.GetField&lt;string&gt;(14),
  
  
  
              };
  
  
  
  
  
              StreamWriter sw = new StreamWriter(PathToStoreDestination);
              CsvWriter scvwrite = new CsvWriter(sw);
              scvwrite.WriteField(shedule.RSA_PIN);
              scvwrite.WriteField(shedule.EMPLOYER_CONTRIBUTION);
              scvwrite.WriteField(shedule.EMPLOYER_VC);
              scvwrite.WriteField(shedule.EMPLOYEE_CONTRIBUTION);
              scvwrite.WriteField(shedule.EMPLOYEE_VC);
              scvwrite.WriteField(shedule.TOTAL_CONTRIBUTION);
              scvwrite.WriteField(shedule.FROM_MONTH);
              scvwrite.WriteField(shedule.FROM_YEAR);
              scvwrite.WriteField(shedule.TO_MONTH);
              scvwrite.WriteField(shedule.TO_YEAR);
              scvwrite.WriteField(shedule.EMPLOYER_CODE);
              scvwrite.WriteField(shedule.EMPLOYEE_NAME);
              scvwrite.WriteField(shedule.PTID);
              scvwrite.WriteField(shedule.RECEIVED_DATE);
              scvwrite.NextRecord();
              scvwrite.Flush();
  
              // Gets field by position returning int
              //  var field = csv.GetField&lt;int&gt;(0);
          }
  
          return RedirectToAction("Index");
      }
  </code></pre>