batiq » 06.07.2005 (Ср) 14:08
Sub LogReader()
Dim bsc, t1, t2, r, r1, s, s1, S2
Dim f, v As String
Dim FileNum As Integer
Dim i, j As Integer
FileNum = FreeFile
' fileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt")
' If fileToOpen <> False Then
' Open fileToOpen For Input As FileNum
' bsc = InputBox("Enter BSN Name")
Cells(1, 1) = "bsc"
Cells(2, 1) = bsc
t1 = "01:00"' 'InputBox("Enter begin time:") t2 = InputBox("Enter end time:")
s1 = "Time Stamp: 04 Jul 2005 01:00:03" 'Empty
r1 = Empty
'Line Input #FileNum, s1
'If s1 = "" Then s1 = "skip" '
' В этом месте InStr возвращает ноль; почему?.
Do While InStr(1, t1, s1, 1) 'And Not EOF(FileNum) '
'Line Input #FileNum, s1
'If s1 = "" Then s1 = "skip"
Loop
' Cells(1, 2) = "Time"
' Cells(2, 2) = s1
' i = 1
' Cells(i, 3) = "(53)"
' Do While (InStr(t2, s1, 1) = 0) And Not EOF(FileNum)
' If (InStr(": (53) Number of service upgrades/do wngrades for HSCSD calls", s1) <> 0) Then
' Line Input #FileNum, s1
' Line Input #FileNum, s1
' i = i + 1
' Cells(i, 3) = s1
' If s1 = "" Then s1 = "skip"
' End If
' Loop
' If Not EOF(FileNum) Then Line Input #FileNum, s1
' End If
i = i + 1
Cells(i, 3) = s1
Close (FileNum)
End Sub