How can I delete the first line of text in a .txt file, then save it... ??? thanks
Printable View
How can I delete the first line of text in a .txt file, then save it... ??? thanks
Try something like:
Code:Private Sub Command1_Click()
Dim iFile As Integer
Dim sFileData As String
iFile = FreeFile
Open "C:\TheFile.txt" For Binary Access Read As iFile
sFileData = Space(LOF(iFile))
Get #iFile, , sFileData
Close iFile
iFile = FreeFile
Open "C:\TheFile.txt" For Output As iFile
Print #iFile, Mid(sFileData, InStr(sFileData, vbCrLf) + 2);
Close iFile
End Sub