hello,
ok I've made a script that reads into a log file,
I've also set it to read into each line, and count the number of lines that begine with a certain character,
what I would like to know is how to display only those lines?
here's the code I've got so far:
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject"
Set f=fs.OpenTextFile(Server.MapPath("testread.txt", 1)
iLineCount = 0
iLineCount_Special = 0
Do Until f.AtEndOfStream 'or whatever this should be
f.Skip(21)
sLine = f.ReadLine
iLineCount = iLineCount + 1
If Left(sLine, 4) = "dest" Then
iLineCount_Special = iLineCount_Special + 1
End If
If Left(sLine, 4) = "file" Then
iLineCount_Special2 = iLineCount_Special + 1
End If
Loop
Response.Write iLineCount & " total SC log file entries.<br />"
Response.Write iLineCount_Special & " total stream requests.<br />"
Response.Write iLineCount_Special2 & " total ondemand file requests.<br />"
Set f=Nothing
Set fs=Nothing
Set fs=Server.CreateObject("Scripting.FileSystemObject"
Set f=fs.OpenTextFile(Server.MapPath("testread.txt", 1)
Response.Write ("<br>"
Response.Write ("<table border=1 cellspacing=1 cellpadding=1><tr><td><font face=arial size=3><b>Line Number</b></td><td><font face=arial size=3><b>Action Logged</b></font></td></tr>"
do while f.AtEndOfStream = false
Response.Write("<tr><td><font face=arial size=2>Line:" & f.Line & " </font></td>"
'Response.Write("<td><font face=arial size=2>Column:" & f.Column & " </font></td>"
f.Skip(19)
Response.Write("<td><font face=arial size=2>" & f.ReadLine & "</font></td>"
Response.Write("</td></tr>"
loop
f.Close
Set f=Nothing
Set fs=Nothing
%>
thanks for your time in advance!
ok I've made a script that reads into a log file,
I've also set it to read into each line, and count the number of lines that begine with a certain character,
what I would like to know is how to display only those lines?
here's the code I've got so far:
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject"
Set f=fs.OpenTextFile(Server.MapPath("testread.txt", 1)
iLineCount = 0
iLineCount_Special = 0
Do Until f.AtEndOfStream 'or whatever this should be
f.Skip(21)
sLine = f.ReadLine
iLineCount = iLineCount + 1
If Left(sLine, 4) = "dest" Then
iLineCount_Special = iLineCount_Special + 1
End If
If Left(sLine, 4) = "file" Then
iLineCount_Special2 = iLineCount_Special + 1
End If
Loop
Response.Write iLineCount & " total SC log file entries.<br />"
Response.Write iLineCount_Special & " total stream requests.<br />"
Response.Write iLineCount_Special2 & " total ondemand file requests.<br />"
Set f=Nothing
Set fs=Nothing
Set fs=Server.CreateObject("Scripting.FileSystemObject"
Set f=fs.OpenTextFile(Server.MapPath("testread.txt", 1)
Response.Write ("<br>"
Response.Write ("<table border=1 cellspacing=1 cellpadding=1><tr><td><font face=arial size=3><b>Line Number</b></td><td><font face=arial size=3><b>Action Logged</b></font></td></tr>"
do while f.AtEndOfStream = false
Response.Write("<tr><td><font face=arial size=2>Line:" & f.Line & " </font></td>"
'Response.Write("<td><font face=arial size=2>Column:" & f.Column & " </font></td>"
f.Skip(19)
Response.Write("<td><font face=arial size=2>" & f.ReadLine & "</font></td>"
Response.Write("</td></tr>"
loop
f.Close
Set f=Nothing
Set fs=Nothing
%>
thanks for your time in advance!