读取多个文件按行读取一个文件一行怎么不行能呢?
读取.log文件,为什么程序执行到 Line Input #1, strtempstrTemp读取的字符串内容要比用UltraEdit工具打开的.log文件一行要多很多内容?如用UltraEdit工具打开的.log第一行内容<IOEXP;
而程序读取缺内容很多。请问这是什么问题呢?
程序如下:
Private Sub cddd_Click()
Dim a() As String
Dim filemanyaddress, files, strfilename, i, fn
Dim strtemp As String
With CommonDialog1
.DialogTitle = "打开"
.CancelError = False
.Filter = "all log (*.log)|*.*"
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
filemanyaddress = .FileName
End With
files = Split(filemanyaddress, Chr(0))
ReDim a(UBound(files))
For i = 1 To UBound(files)
a(i) = files(0) & "\" & files(i)
Next i
''---------------------------------------------------------------------------------------------------------
For fn = 1 To UBound(a)
Dim s As String
Open a(fn) For Binary As #1
Do While Not EOF(1)
Line Input #1, strtemp(出现问题)
MsgBox strtemp
Select Case strtemp
Case "<RLCFP:CELL=ALL;"
Call RLCFP
Case "<RLDEP:CELL=ALL;"
Call RLDEP
Case "<RLNRP:CELL=ALL;"
Call RLNRP
End Select
Loop
Close #1
Next fn
End Sub
请大手子帮忙看看?读取文件如下:
CDDlog.rar
(579.75 KB)