How to delete line in text file ? I have 5 lines that I saved in text file, but i want to delete the last line and replace with a new value. Any idea ?
Dim l As List = File.ReadList("filePath", "filename") 'put each line of the text file into a list
l.RemoveAt(l.Size-1) 'remove the last line
l.Add("new line text here") 'add your new line
File.WriteList("savePath", "filename", l) 'save the list to a new file (if necessary)