I need help changing the csv values. Bit under pressure now, I have only written script for the header portion. Even that is not working.
My code.
string[] myfile = File.ReadAllLines(csvFile);
string[] header = myfile[0].Split(',');
List<string> newLines = new List<string>();
for (int z=0; z<header.Count();z++)
{
if (header[z] == "AMOUNT")
{
var totheader = header[z].Replace("AMOUNT","TOTAL");
header[z] = totheader;
}
string newLine = string.Join(",", header);
newLines.Add(newLine);
}
File.WriteAllLines(myfile[0], newLines.ToArray());
I need to change
1. AMOUNT header to TOTAL
2. The date field need to change to 2019-06-24
I need help changing the csv values. Bit under pressure now, I have only written script for the header portion. Even that is not working.
Results should be
Thank you in advance.