I have created CSV file using comma (,) separator using following code.
DataTable dt = dataSet.Tables[0];
StringBuilder csv = new StringBuilder();
for (int i = 0; i < dt.Rows.Count; i++)
{
for (int k = 0; k < dt.Columns.Count; k++)
{
csv.Append(dt.Rows[i][k].ToString() + ',');
}
csv.Append("\r\n");
}
File.WriteAllText(filePath, csv.ToString());
If I use comma, data divided into column properly. But when I try "|", it doesn't divide into columns
How can I change separator? I want to use "|" as a separator.