【发布时间】:2015-07-14 20:56:32
【问题描述】:
我已阅读这篇文章:Read/Parse text file line by line in VBA。这篇文章告诉你如何从文本文件中读取一行。但是,我需要读取一行并检查它是否包含数字,如果包含,我需要删除该行并保存文本文件。
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
我可以读取该行并检查它是否包含数字。但我不确定如何删除该行并保存文本文件。在这方面需要一些指导。
【问题讨论】: