I want to add header for my .csv file.Code snippet is here.The problem is.my code only prints first heading on all columns.
Can you please help whats wrong.It only prints DeviceIdent in all columns.I want to see all columns in proper heading.
Can you please help whats wrong.It only prints DeviceIdent in all columns.I want to see all columns in proper heading.
Code:
string fileLocation = @"C:\Data\Test.csv";
if (!File.Exists(fileLocation))
{
File.Create(fileLocation).Close();
}
string header =( "DeviceIdent" + "," + "Chipset" + "," + "Manufacturer" + "," + "Model" + "," + "Name" ) + Environment.NewLine;
File.AppendAllText(fileLocation, header);