Katya85S
Programmer
- Jul 19, 2004
- 190
In access project the application should delete one row (starting with 'DL~') from txt file? Is it possible at all?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub myTestSub()
Dim fso, f1, f2, s As String
Const ForReading = 1, ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile("c:\inputfile.txt", ForReading)
Set f2 = fso.CreateTextFile("c:\outputfile.txt", True)
While Not f1.AtEndOfStream
s = f1.ReadLine
If Left(s, 3) <> "DL~" Then f2.WriteLine s
WEnd
f1.Close: f2.Close
Set f1 = Nothing: Set f2 = Nothing: Set fso = Nothing
End Sub