title: How to write to csv file with StringBuilder ignoring the first row/line of CSV?
body: <p>Since the first row of this CSV file already includes the column names, so I just want to ignore the first line and start to write from second line with StringBuilder.</p>
  
  <pre><code>StringBuilder sb = new StringBuilder();
              foreach (DataRow dr in distinctValues.Rows)
              {
                  vendor = dr.ItemArray[0].ToString();
                  for (int i = 0; i &lt;= ds.Tables[0].Rows.Count - 1; i++)
                  {
                      if (vendor == ds.Tables[0].Rows[i]["VendorCode"].ToString())
                      {
                          for (int j = 0; j &lt;= ds.Tables[0].Columns.Count - 1; j++)
                          {
                              if (j != 0)
                                  sb.Append(",");
                              sb.Append(ds.Tables[0].Rows[i][ds.Tables[0].Columns[j]]);
                          }
                          sb.AppendLine();
                      }
                  }
                  File.WriteAllText(@csvFile, sb.ToString());
              }
  </code></pre>
  
  <p>At last i understand that what i need is not to write a file but edit a file. so a changing of mind finally gives the answer.
  <strong>File.AppendAllText</strong> is what i really need.</p>