想在一个文本文件中进行逐行数据比较,代码如下:
Private Sub Command1_Click()
Dim preStr As String, curStr As String, aa As String
Open "c:\windows\desktop\errswsj" For Input As #1
Open "c:\windows\desktop\a" For Output As #2
Do While Not EOF(1)
Line Input #1, curStr
If curStr <> preStr Then
Print #2, curStr
End If
preStr = curStr
Loop
Close #1
Close #2
MsgBox ("ok")
Unload Me
End Sub
但用LINE INPUT #只能读取整个文件数据,不能逐行读取,不知为何?请教各位!
Private Sub Command1_Click()
Dim preStr As String, curStr As String, aa As String
Open "c:\windows\desktop\errswsj" For Input As #1
Open "c:\windows\desktop\a" For Output As #2
Do While Not EOF(1)
Line Input #1, curStr
If curStr <> preStr Then
Print #2, curStr
End If
preStr = curStr
Loop
Close #1
Close #2
MsgBox ("ok")
Unload Me
End Sub
但用LINE INPUT #只能读取整个文件数据,不能逐行读取,不知为何?请教各位!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货