I have read this post: Read/Parse text file line by line in VBA. This post tells you how to read a line from a text file. However, I need to read a line and check whether it contains a number and if it does, I need to delete the line and save the text file.
While Not EOF(FileNum)
Line Input #FileNum, DataLine
If FindValue(DataLine) Then
'Stuck here.
End If
Wend
End Sub
Function FindValue(ByVal DataLine As Variant) As Boolean
For Index = 0 To NoOfLiquidatedDeals - 1
pos = InStr(DataLine, NoOfLiquidatedDealsArray(Index))
If pos > 0 Then
FindValue = True
End If
Next
End Function
I can read the line and check whether it contains a number. But I am not sure how to delete the line and save the text file. Need some guidance on this.