This forum is for posting the questions related to asp . So if you want to post your question regarding VB you have to post it in the respected forum.
The functionality that you require can be done using following lines of code :
Code:
Private Function DeleteLines(ByVal from_name As String, _
ByVal to_name As String, ByVal target As String) As Long
Dim strlen As Integer
Dim from_file As Integer
Dim to_file As Integer
Dim one_line As String
Dim deleted As Integer
' Open the input file.
from_file = FreeFile
Open from_name For Input As from_file
' Open the output file.
to_file = FreeFile
Open to_name For Output As to_file
' Copy the file skipping lines containing the
' target.
deleted = 0
Do While Not EOF(from_file)
Line Input #from_file, one_line
If InStr(one_line, target) = 0 Then
Print #to_file, one_line
Else
deleted = deleted + 1
End If
Loop
' Close the files.
Close from_file
Close to_file
DeleteLines = deleted
End Function
Originally posted by aadsaca
Hi there,
i just want to know the syntax on how
to remove line on text file using
vb...
Comment