Private Sub t()
Dim content As String
Dim var As Variant
Dim path As String
'put the path and filename of textfile here
path = Environ$("userprofile") & "\desktop\t.txt"
With CreateObject("Scripting.FileSystemObject")
With .opentextfile(path, 1)
content = .ReadAll
.Close
End With
var = Split(content, vbCrLf)
For i = 1 To UBound(var)
var(i - 1) = var(i)
Next
ReDim Preserve var(UBound(var) - 1)
content = Join(var, vbCrLf)
With .opentextfile(path, 2)
.Write content
.Close
End With
End With
End Sub