I'm able to read rows separated by "~" but once I try to read the values separated by comma, my output returns nothing.
Any help is appreciated!
strInput is a .csv file.
Content= strField[0],strField[1],strField[2],strField[3],srField[4],strField[5]~
strField[0],strField[1],strField[2],strField[3],srField[4],strField[5]~
strField[0],strField[1],strField[2],strField[3],srField[4],strField[5]~
using (StreamWriter write = new StreamWriter(filePath, true)){
string[] line = strInput.Split('~');
foreach (string part in line)
{
string[] strField = part.Split(',');
strDetails += "" + "," + "Heading1" + "," + "Heading2 + "," + strField[0] + "," + strField[5] + "," + strField[1] + "," + strField[2] + "," + strField[4] + "~";
write.WriteLine(strDetails);
}
}