I have a text file which stores information about the production information and process. The process consists of several phases such as Stripping, Cleaning, Paint etc. These phases are stored with dates which could be expected date, start date, finished date, delay date.
An example .txt file:
567,Eindhoven,21,Stripping_e=20/05/2020,Stripping_s=21/05/2020,Stripping_f=22/05/2020,Cleaning_e=23/05/2020,Cleaning_s=27/05/2020,Cleaning_f=28/05/2020,Paint_e=28/05/2020,Panint_s=28/05/2020,Paint_f=29/05/2020,Cabinet_e=29/05/2020,Cabinet_s=31/05/2020,Cabinet_f=,Table_e=,Table_s=,Table_f=,Stand_e=,Stand_s=,Stand_f=,Display_e=,Display_s=,Display_f=,UControls_e=,UControls_s=,UControls_f=,Test_e=,Test_s=,Test_f=,Prepack_e=,Prepack_s=,Prepack_f=,Endpack_e=,Endpack_s=,Endpack_f=,Release_e=,Release_s=,Release_f=,
After I read this .txt file, I store it inside a dataGridView like:

However, I do not know how to just add the latest date into the corresponding column. I want to override the Stripping_e value in Stripping column if I see Stripping_f in the text file. And same for the rest of the columns. It is also the thing that I do not necessarily have a date (expected, started, finished or delayed) for a column.
Here is the code I am currently using:
private void IGT_Load(object sender, EventArgs e)
{
table.Columns.Add("SalesNr", typeof(int));
table.Columns.Add("PName", typeof(string));
table.Columns.Add("Type", typeof(int));
table.Columns.Add("Stripping", typeof(string));
table.Columns.Add("Cleaning", typeof(string));
table.Columns.Add("Paint", typeof(string));
table.Columns.Add("Cabinet", typeof(string));
table.Columns.Add("Table", typeof(string));
table.Columns.Add("Stand", typeof(string));
table.Columns.Add("Display", typeof(string));
table.Columns.Add("User Controls", typeof(string));
table.Columns.Add("Test", typeof(string));
table.Columns.Add("Pre-pack", typeof(string));
table.Columns.Add("End-pack", typeof(string));
table.Columns.Add("Release for Delivery", typeof(string));
dataGridView1.DataSource = table;
Import();
}
private void Import()
{
// get lines from the text file
string[] lines = File.ReadAllLines(@"..\..\567.txt");
string[] values;
for (int i = 0; i < lines.Length; i++)
{
values = lines[i].ToString().Split(',', '=');
string[] row = new string[values.Length];
for (int j = 0; j < values.Length; j++)
{
if(values[j] == "Stripping_e")
{
row[j] = values[j + 1].Trim();
j++;
}
else if (values[j] == "Stripping_s")
{
row[j-2] = values[j+1].Trim();
j++;
}
else if(values[j] == "Cleaning_s" || values[j] == "Cleaning_e" || values[j] == "Cleaning_f" || values[j] == "Cleaning_d")
{
row[j] = values[j + 1].Trim();
}
else
{
row[j] = values[j].Trim();
}
}
table.Rows.Add(row);
}
}
table is a DataTable connected to the dataGridView1 as DataSource.
I have never worked with text files before so I would really appreciate your help!

