I am editing a textfile and changing content from one value to another. Everything works fine so far but I have reached a dead end when it comes to deleting a line i that file. I want a function that reads a file with similar content as below...
Name Peter
Length 185
Name Susan
Length
Name Harry
Length 177
and removes all lines with the word Length NOT followed by anything and gives the result
Name Peter
Length 185
Name Susan
Name Harry
Length 177
I have used the code
System.IO.File.WriteAllLines(
strLabelExportTotal,
File.ReadAllLines(strLabelExportPreLenAdjust)
.Select(1 => 1 == "LENGTH " ? "LENGTH 0" : 1));
to set that if a value after the word Length is missing it should ad the value 0. But now I want the line to disappear...