J
Joey Martin
I am scanning an HTML file.
I need to gather certain data from areas that start with <SMALL> text.
Let me show the code, then explain more.
----
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(TheFilePath)
Set ts = f.OpenAsTextStream(1,-2)
Section = "Header"
Do While not ts.AtEndOfStream
Tmp_Line = ts.ReadLine
Select Case mid(Tmp_Line,48,2)
Case " "
Section = "TheMoney"
Case "Pi"
Section = "ThePick"
Case ">J"
Section = "TheDate"
End Select
Select Case Section
Case "TheMoney"
TheMoney = TheMoney & FixGrades(Tmp_Line) & CHR(13)
Case "ThePick"
ThePick = ThePick & FixGrades(Tmp_Line) & CHR(13)
Case "TheDate"
TheDate = TheDate & FixGrades(Tmp_Line) & CHR(13)
End Select
TextStreamTest = TextStreamTest & CHR(13) & FixGrades(Tmp_Line)
response.write TheMoney & "<BR>"
response.write ThePick & "<BR>"
response.write TheDate & "<BR>"
Loop
ts.Close
-----------
My end result is to be able to grab TheMoney,ThePick,TheDate and then insert
them into a sql db. Then to scan more html to find the next instance of the
information and insert into database. I can do all the db stuff. The data is
just not pulling correctly. And it scans EVERY LINE instead of only the
sections that start with the HTML code <SMALL>. How would I get it to do
this? Then, do you see anything else I am doing wrong for my end result?
I'd image seeing the text with my response.write displayed as:
TheMoney
ThePick
TheDate
then scanning the html and finding another instance
TheMoney
ThePick
TheDate
etc....
I need to gather certain data from areas that start with <SMALL> text.
Let me show the code, then explain more.
----
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(TheFilePath)
Set ts = f.OpenAsTextStream(1,-2)
Section = "Header"
Do While not ts.AtEndOfStream
Tmp_Line = ts.ReadLine
Select Case mid(Tmp_Line,48,2)
Case " "
Section = "TheMoney"
Case "Pi"
Section = "ThePick"
Case ">J"
Section = "TheDate"
End Select
Select Case Section
Case "TheMoney"
TheMoney = TheMoney & FixGrades(Tmp_Line) & CHR(13)
Case "ThePick"
ThePick = ThePick & FixGrades(Tmp_Line) & CHR(13)
Case "TheDate"
TheDate = TheDate & FixGrades(Tmp_Line) & CHR(13)
End Select
TextStreamTest = TextStreamTest & CHR(13) & FixGrades(Tmp_Line)
response.write TheMoney & "<BR>"
response.write ThePick & "<BR>"
response.write TheDate & "<BR>"
Loop
ts.Close
-----------
My end result is to be able to grab TheMoney,ThePick,TheDate and then insert
them into a sql db. Then to scan more html to find the next instance of the
information and insert into database. I can do all the db stuff. The data is
just not pulling correctly. And it scans EVERY LINE instead of only the
sections that start with the HTML code <SMALL>. How would I get it to do
this? Then, do you see anything else I am doing wrong for my end result?
I'd image seeing the text with my response.write displayed as:
TheMoney
ThePick
TheDate
then scanning the html and finding another instance
TheMoney
ThePick
TheDate
etc....