var lines = System.IO.File.ReadAllLines("..."); System.IO.File.WriteAllLines("...", lines.Take(lines.Length - 1).ToArray());