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.... 20 1664
Do you know for a fact that all lines will be at least 49 characters long?
You could do something like this:
Do While not ts.AtEndOfStream
sPart = Mid(ts.ReadLine & String(49," "), 48, 2)
Select Case sPart
Case " "
TheMoney = TheMoney & FixGrades(sPart) & CHR(13)
Case "Pi"
ThePick = ThePick & FixGrades(sPart) & CHR(13)
Case ">J"
TheDate = TheDate & FixGrades(sPart) & CHR(13)
End Select
I didn't really follow exactly what your goal is, so I figured I'd just trim
down your code a little. :]
Ray at work
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:Uz****************@bignews1.bellsouth.net... 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....
> Do While not ts.AtEndOfStream sPart = Mid(ts.ReadLine & String(49," "), 48, 2)
No offense Ray, but whenever I see this technique, I always try to correct
it. I think the following will be much more efficient (to a certain file
size threshold, at least), since you're not keeping a handle on the file
throughout your coding logic.
s = ts.ReadAll()
ts.close: set ts = nothing
s = split(s, VBCrLf)
for i = 0 to ubound(s)
sPart = Mid(s(i) & String(49, " "), 48, 2)
...
next
There will be an upper bound to the improved efficiency, as calling
readall() on a 50 MB file is not likely to be pretty. But I think in most
cases the above is a better technique than While not AtEndOfStream.
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:#D**************@TK2MSFTNGP10.phx.gbl... Do you know for a fact that all lines will be at least 49 characters long? You could do something like this:
Do While not ts.AtEndOfStream sPart = Mid(ts.ReadLine & String(49," "), 48, 2) Select Case sPart Case " " TheMoney = TheMoney & FixGrades(sPart) & CHR(13) Case "Pi" ThePick = ThePick & FixGrades(sPart) & CHR(13) Case ">J" TheDate = TheDate & FixGrades(sPart) & CHR(13) End Select
I didn't really follow exactly what your goal is, so I figured I'd just
trim down your code a little. :]
Ray at work "Joey Martin" <jo**@infosmiths.net> wrote in message news:Uz****************@bignews1.bellsouth.net... 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....
Ray and Aaron,
Thanks for your input...but it still does not help me get to my end result.
I only want it to start looking at blocks of code that start with <SMALL>
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl... Do While not ts.AtEndOfStream sPart = Mid(ts.ReadLine & String(49," "), 48, 2)
No offense Ray, but whenever I see this technique, I always try to correct it. I think the following will be much more efficient (to a certain file size threshold, at least), since you're not keeping a handle on the file throughout your coding logic.
s = ts.ReadAll() ts.close: set ts = nothing s = split(s, VBCrLf) for i = 0 to ubound(s) sPart = Mid(s(i) & String(49, " "), 48, 2) ... next
There will be an upper bound to the improved efficiency, as calling readall() on a 50 MB file is not likely to be pretty. But I think in most cases the above is a better technique than While not AtEndOfStream.
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in message news:#D**************@TK2MSFTNGP10.phx.gbl... Do you know for a fact that all lines will be at least 49 characters
long? You could do something like this:
Do While not ts.AtEndOfStream sPart = Mid(ts.ReadLine & String(49," "), 48, 2) Select Case sPart Case " " TheMoney = TheMoney & FixGrades(sPart) & CHR(13) Case "Pi" ThePick = ThePick & FixGrades(sPart) & CHR(13) Case ">J" TheDate = TheDate & FixGrades(sPart) & CHR(13) End Select
I didn't really follow exactly what your goal is, so I figured I'd just trim down your code a little. :]
Ray at work "Joey Martin" <jo**@infosmiths.net> wrote in message news:Uz****************@bignews1.bellsouth.net... 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....
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl... Do While not ts.AtEndOfStream sPart = Mid(ts.ReadLine & String(49," "), 48, 2) No offense Ray, but whenever I see this technique, I always try to correct it. I
s = ts.ReadAll() ts.close: set ts = nothing s = split(s, VBCrLf)
But I think in most cases the above is a better technique than While not AtEndOfStream.
Not offended. I agree!
Ray at work
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:Yq*****************@bignews4.bellsouth.net... Ray and Aaron, Thanks for your input...but it still does not help me get to my end
result. I only want it to start looking at blocks of code that start with <SMALL>
Blocks of code? Lines in the file? Can you post a snippet from a sample
file that you're reading or something so we can try to understand what
you're trying to do?
Ray at work
Here is a sample of the file I am importing:
<small>
<TR>
<TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td>
</tr></small>
There is additional html before the first <small> that I want to ignore. I
pretty much want to bring in each piece of information that is within that
block of text minus the html codes, for each INSTANCE of that section that
appears.
Thanks for the help!
This probably isn't the best method around, as they're may be a better way
using regular expressions and what not, but it will give basic
functionality.
Function SuckSmall(theLine)
Dim iStart, iEnd
SuckSmall = ""
iStart = InStr(1, theLine, "<small>", 1)
If iStart = 0 Then Exit Function
iEnd = InStr(iStart, theLine, "</small>", 1)
If iEnd = 0 Then Exit Function
SuckSmall = Mid(theLine, iStart + 7, iEnd - iStart - 7)
''''7 is the length of "<small>" which is where the iStart will be
End Function
''(see Aaron's post)
s = ts.ReadAll()
ts.close: set ts = nothing
s = split(s, VBCrLf)
for i = 0 to ubound(s)
sData = SuckSmall(s(i))
If sData <> "" Then Response.write sData & "<br>"
next
Ray at work
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:aH******************@bignews3.bellsouth.net.. . Here is a sample of the file I am importing:
<small> <TR> <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td> </tr></small>
There is additional html before the first <small> that I want to ignore. I pretty much want to bring in each piece of information that is within that block of text minus the html codes, for each INSTANCE of that section that appears.
Thanks for the help!
Sheesh, why don't you store information in a database instead of a text
file?
Or have you considered using CSS, and some kind of marker to indicate a
valid data row? Imagine how much easier it would be if you had this:
<crap HTML we don't care about>blah</crap>
<TR>
<!-- start -->
<TD Class=right>$4,962</TD>
<TD Class=mid>Pick 6</TD>
<TD Class=mid>Hastings</TD>
<TD Class=mid>June 12, 2004</TD>
<!-- end -->
</TR>
<TR>
<!-- start -->
<TD Class=right>$200</TD>
<TD Class=mid>Pick 4</TD>
<TD Class=mid>New York</TD>
<TD Class=mid>June 18, 2004</TD>
<!-- end -->
</TR>
Anyway, I won't produce the code for that, because the typical response is
"pointy-haired boss won't let me change the format of the file." So,
....
s = ts.ReadAll()
ts.close: set ts = nothing
s = split(s, VBCrLf)
for i = 0 to ubound(s)
s(i) = trim(s(i))
bg = instr(s(i), "BGCOLOR")
s1 = instr(s(i), "<small>")
s2 = instr(s(i), "</small>")
if s1 = 1 then response.write "-------<br>"
if bg > 0 then
if s1 > bg and s2 > s1 then
response.write mid(s(i), s1+7, s2-(s1+7))
response.write "<br>"
end if
end if
next
response.write "-------<br>"
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:aH******************@bignews3.bellsouth.net.. . Here is a sample of the file I am importing:
<small> <TR> <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td> </tr></small>
There is additional html before the first <small> that I want to ignore. I pretty much want to bring in each piece of information that is within that block of text minus the html codes, for each INSTANCE of that section that appears.
Thanks for the help!
Wow...that was perfect...I know the first thing I was doing wrong was the
use of the INSTR function.
Anyways...thanks so much!
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Oa**************@TK2MSFTNGP10.phx.gbl... Sheesh, why don't you store information in a database instead of a text file?
Or have you considered using CSS, and some kind of marker to indicate a valid data row? Imagine how much easier it would be if you had this:
<crap HTML we don't care about>blah</crap> <TR> <!-- start --> <TD Class=right>$4,962</TD> <TD Class=mid>Pick 6</TD> <TD Class=mid>Hastings</TD> <TD Class=mid>June 12, 2004</TD> <!-- end --> </TR> <TR> <!-- start --> <TD Class=right>$200</TD> <TD Class=mid>Pick 4</TD> <TD Class=mid>New York</TD> <TD Class=mid>June 18, 2004</TD> <!-- end --> </TR>
Anyway, I won't produce the code for that, because the typical response is "pointy-haired boss won't let me change the format of the file." So,
...
s = ts.ReadAll() ts.close: set ts = nothing
s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then response.write "-------<br>" if bg > 0 then if s1 > bg and s2 > s1 then response.write mid(s(i), s1+7, s2-(s1+7)) response.write "<br>" end if end if next response.write "-------<br>" -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:aH******************@bignews3.bellsouth.net.. . Here is a sample of the file I am importing:
<small> <TR> <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12,
2004</small></td> </tr></small>
There is additional html before the first <small> that I want to ignore.
I pretty much want to bring in each piece of information that is within
that block of text minus the html codes, for each INSTANCE of that section
that appears.
Thanks for the help!
Hmmm....trying to figure out how to insert each block into database field,
themoney,thepick,thetrack,thedate
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Oa**************@TK2MSFTNGP10.phx.gbl... Sheesh, why don't you store information in a database instead of a text file?
Or have you considered using CSS, and some kind of marker to indicate a valid data row? Imagine how much easier it would be if you had this:
<crap HTML we don't care about>blah</crap> <TR> <!-- start --> <TD Class=right>$4,962</TD> <TD Class=mid>Pick 6</TD> <TD Class=mid>Hastings</TD> <TD Class=mid>June 12, 2004</TD> <!-- end --> </TR> <TR> <!-- start --> <TD Class=right>$200</TD> <TD Class=mid>Pick 4</TD> <TD Class=mid>New York</TD> <TD Class=mid>June 18, 2004</TD> <!-- end --> </TR>
Anyway, I won't produce the code for that, because the typical response is "pointy-haired boss won't let me change the format of the file." So,
...
s = ts.ReadAll() ts.close: set ts = nothing
s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then response.write "-------<br>" if bg > 0 then if s1 > bg and s2 > s1 then response.write mid(s(i), s1+7, s2-(s1+7)) response.write "<br>" end if end if next response.write "-------<br>" -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:aH******************@bignews3.bellsouth.net.. . Here is a sample of the file I am importing:
<small> <TR> <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12,
2004</small></td> </tr></small>
There is additional html before the first <small> that I want to ignore.
I pretty much want to bring in each piece of information that is within
that block of text minus the html codes, for each INSTANCE of that section
that appears.
Thanks for the help!
As one string into one column? Separated by what, commas, VBCrLf, HTML line
breaks, ...?
BE SPECIFIC.
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:NU**************@bignews6.bellsouth.net... Hmmm....trying to figure out how to insert each block into database field, themoney,thepick,thetrack,thedate "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Oa**************@TK2MSFTNGP10.phx.gbl... Sheesh, why don't you store information in a database instead of a text file?
Or have you considered using CSS, and some kind of marker to indicate a valid data row? Imagine how much easier it would be if you had this:
<crap HTML we don't care about>blah</crap> <TR> <!-- start --> <TD Class=right>$4,962</TD> <TD Class=mid>Pick 6</TD> <TD Class=mid>Hastings</TD> <TD Class=mid>June 12, 2004</TD> <!-- end --> </TR> <TR> <!-- start --> <TD Class=right>$200</TD> <TD Class=mid>Pick 4</TD> <TD Class=mid>New York</TD> <TD Class=mid>June 18, 2004</TD> <!-- end --> </TR>
Anyway, I won't produce the code for that, because the typical response
is "pointy-haired boss won't let me change the format of the file." So,
...
s = ts.ReadAll() ts.close: set ts = nothing
s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then response.write "-------<br>" if bg > 0 then if s1 > bg and s2 > s1 then response.write mid(s(i), s1+7, s2-(s1+7)) response.write "<br>" end if end if next response.write "-------<br>" -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:aH******************@bignews3.bellsouth.net.. . Here is a sample of the file I am importing:
<small> <TR> <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td> </tr></small>
There is additional html before the first <small> that I want to
ignore. I pretty much want to bring in each piece of information that is within that block of text minus the html codes, for each INSTANCE of that section that appears.
Thanks for the help!
Your code returns the following:
$8,394
Pick 6
Bay Meadows
June 10, 2004
-------
$7,496
Pick 6
Los Alamitos
June 10, 2004
I would like to enter the 1st grouping into a db table called co_results.
line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack field,
and line 4 is TheDate field.
Then go to the next grouping and insert a new row of data. And on and on....
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uq*************@TK2MSFTNGP11.phx.gbl... As one string into one column? Separated by what, commas, VBCrLf, HTML
line breaks, ...?
BE SPECIFIC.
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:NU**************@bignews6.bellsouth.net... Hmmm....trying to figure out how to insert each block into database
field, themoney,thepick,thetrack,thedate "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Oa**************@TK2MSFTNGP10.phx.gbl... Sheesh, why don't you store information in a database instead of a
text file?
Or have you considered using CSS, and some kind of marker to indicate
a valid data row? Imagine how much easier it would be if you had this:
<crap HTML we don't care about>blah</crap> <TR> <!-- start --> <TD Class=right>$4,962</TD> <TD Class=mid>Pick 6</TD> <TD Class=mid>Hastings</TD> <TD Class=mid>June 12, 2004</TD> <!-- end --> </TR> <TR> <!-- start --> <TD Class=right>$200</TD> <TD Class=mid>Pick 4</TD> <TD Class=mid>New York</TD> <TD Class=mid>June 18, 2004</TD> <!-- end --> </TR>
Anyway, I won't produce the code for that, because the typical
response is "pointy-haired boss won't let me change the format of the file." So,
...
s = ts.ReadAll() ts.close: set ts = nothing
s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then response.write "-------<br>" if bg > 0 then if s1 > bg and s2 > s1 then response.write mid(s(i), s1+7, s2-(s1+7)) response.write "<br>" end if end if next response.write "-------<br>" -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:aH******************@bignews3.bellsouth.net.. . > Here is a sample of the file I am importing: > > <small> > <TR> > <TD ALIGN="right" BGCOLOR="FFFFFF"><small>
$4,962</small></TD> > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD> > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td> > </tr></small> > > > There is additional html before the first <small> that I want to ignore. I > pretty much want to bring in each piece of information that is
within that > block of text minus the html codes, for each INSTANCE of that
section that > appears. > > Thanks for the help! > >
Now, does co_results have any specific data structure? Just one column?
What is the column called?
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:W1*****************@bignews5.bellsouth.net... Your code returns the following:
$8,394 Pick 6 Bay Meadows June 10, 2004 ------- $7,496 Pick 6 Los Alamitos June 10, 2004
I would like to enter the 1st grouping into a db table called co_results. line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack
field, and line 4 is TheDate field.
Then go to the next grouping and insert a new row of data. And on and
on....
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:uq*************@TK2MSFTNGP11.phx.gbl... As one string into one column? Separated by what, commas, VBCrLf, HTML line breaks, ...?
BE SPECIFIC.
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:NU**************@bignews6.bellsouth.net... Hmmm....trying to figure out how to insert each block into database field, themoney,thepick,thetrack,thedate "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Oa**************@TK2MSFTNGP10.phx.gbl... > Sheesh, why don't you store information in a database instead of a text > file? > > Or have you considered using CSS, and some kind of marker to
indicate a > valid data row? Imagine how much easier it would be if you had
this: > > <crap HTML we don't care about>blah</crap> > <TR> > <!-- start --> > <TD Class=right>$4,962</TD> > <TD Class=mid>Pick 6</TD> > <TD Class=mid>Hastings</TD> > <TD Class=mid>June 12, 2004</TD> > <!-- end --> > </TR> > <TR> > <!-- start --> > <TD Class=right>$200</TD> > <TD Class=mid>Pick 4</TD> > <TD Class=mid>New York</TD> > <TD Class=mid>June 18, 2004</TD> > <!-- end --> > </TR> > > Anyway, I won't produce the code for that, because the typical
response is > "pointy-haired boss won't let me change the format of the file."
So, > > ... > > s = ts.ReadAll() > ts.close: set ts = nothing > > s = split(s, VBCrLf) > for i = 0 to ubound(s) > s(i) = trim(s(i)) > bg = instr(s(i), "BGCOLOR") > s1 = instr(s(i), "<small>") > s2 = instr(s(i), "</small>") > if s1 = 1 then response.write "-------<br>" > if bg > 0 then > if s1 > bg and s2 > s1 then > response.write mid(s(i), s1+7, s2-(s1+7)) > response.write "<br>" > end if > end if > next > response.write "-------<br>" > > > > -- > http://www.aspfaq.com/ > (Reverse address to reply.) > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > news:aH******************@bignews3.bellsouth.net.. . > > Here is a sample of the file I am importing: > > > > <small> > > <TR> > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD> > > > > <TD BGCOLOR="FFFFFF"
ALIGN="CENTER"><small>Hastings</small></TD> > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, 2004</small></td> > > </tr></small> > > > > > > There is additional html before the first <small> that I want to ignore. I > > pretty much want to bring in each piece of information that is within that > > block of text minus the html codes, for each INSTANCE of that section that > > appears. > > > > Thanks for the help! > > > > > >
Columns...
TheMoney
ThePick
TheTrack
TheDate
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl... Now, does co_results have any specific data structure? Just one column? What is the column called?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:W1*****************@bignews5.bellsouth.net... Your code returns the following:
$8,394 Pick 6 Bay Meadows June 10, 2004 ------- $7,496 Pick 6 Los Alamitos June 10, 2004
I would like to enter the 1st grouping into a db table called
co_results. line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack field, and line 4 is TheDate field.
Then go to the next grouping and insert a new row of data. And on and on....
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:uq*************@TK2MSFTNGP11.phx.gbl... As one string into one column? Separated by what, commas, VBCrLf,
HTML line breaks, ...?
BE SPECIFIC.
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:NU**************@bignews6.bellsouth.net... > Hmmm....trying to figure out how to insert each block into database field, > themoney,thepick,thetrack,thedate > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > Sheesh, why don't you store information in a database instead of a text > > file? > > > > Or have you considered using CSS, and some kind of marker to indicate a > > valid data row? Imagine how much easier it would be if you had this: > > > > <crap HTML we don't care about>blah</crap> > > <TR> > > <!-- start --> > > <TD Class=right>$4,962</TD> > > <TD Class=mid>Pick 6</TD> > > <TD Class=mid>Hastings</TD> > > <TD Class=mid>June 12, 2004</TD> > > <!-- end --> > > </TR> > > <TR> > > <!-- start --> > > <TD Class=right>$200</TD> > > <TD Class=mid>Pick 4</TD> > > <TD Class=mid>New York</TD> > > <TD Class=mid>June 18, 2004</TD> > > <!-- end --> > > </TR> > > > > Anyway, I won't produce the code for that, because the typical
response is > > "pointy-haired boss won't let me change the format of the file." So, > > > > ... > > > > s = ts.ReadAll() > > ts.close: set ts = nothing > > > > s = split(s, VBCrLf) > > for i = 0 to ubound(s) > > s(i) = trim(s(i)) > > bg = instr(s(i), "BGCOLOR") > > s1 = instr(s(i), "<small>") > > s2 = instr(s(i), "</small>") > > if s1 = 1 then response.write "-------<br>" > > if bg > 0 then > > if s1 > bg and s2 > s1 then > > response.write mid(s(i), s1+7, s2-(s1+7)) > > response.write "<br>" > > end if > > end if > > next > > response.write "-------<br>" > > > > > > > > -- > > http://www.aspfaq.com/ > > (Reverse address to reply.) > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > news:aH******************@bignews3.bellsouth.net.. . > > > Here is a sample of the file I am importing: > > > > > > <small> > > > <TR> > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick
6</small></TD> > > > > > > <TD BGCOLOR="FFFFFF"
ALIGN="CENTER"><small>Hastings</small></TD> > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > 2004</small></td> > > > </tr></small> > > > > > > > > > There is additional html before the first <small> that I want to ignore. > I > > > pretty much want to bring in each piece of information that is
within > that > > > block of text minus the html codes, for each INSTANCE of that section > that > > > appears. > > > > > > Thanks for the help! > > > > > > > > > > > >
What the heck purpose does the "The" prefix serve? Also, what are the
datatypes (is TheMoney a money datatype, a string... is TheDate a datetime,
a string, ...)?
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:7c*******************@bignews2.bellsouth.net. .. Columns... TheMoney ThePick TheTrack TheDate
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Of**************@TK2MSFTNGP10.phx.gbl... Now, does co_results have any specific data structure? Just one column? What is the column called?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:W1*****************@bignews5.bellsouth.net... Your code returns the following:
$8,394 Pick 6 Bay Meadows June 10, 2004 ------- $7,496 Pick 6 Los Alamitos June 10, 2004
I would like to enter the 1st grouping into a db table called co_results. line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack field, and line 4 is TheDate field.
Then go to the next grouping and insert a new row of data. And on and on....
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:uq*************@TK2MSFTNGP11.phx.gbl... > As one string into one column? Separated by what, commas, VBCrLf, HTML line > breaks, ...? > > BE SPECIFIC. > > -- > http://www.aspfaq.com/ > (Reverse address to reply.) > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > news:NU**************@bignews6.bellsouth.net... > > Hmmm....trying to figure out how to insert each block into
database field, > > themoney,thepick,thetrack,thedate > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > Sheesh, why don't you store information in a database instead of
a text > > > file? > > > > > > Or have you considered using CSS, and some kind of marker to
indicate a > > > valid data row? Imagine how much easier it would be if you had this: > > > > > > <crap HTML we don't care about>blah</crap> > > > <TR> > > > <!-- start --> > > > <TD Class=right>$4,962</TD> > > > <TD Class=mid>Pick 6</TD> > > > <TD Class=mid>Hastings</TD> > > > <TD Class=mid>June 12, 2004</TD> > > > <!-- end --> > > > </TR> > > > <TR> > > > <!-- start --> > > > <TD Class=right>$200</TD> > > > <TD Class=mid>Pick 4</TD> > > > <TD Class=mid>New York</TD> > > > <TD Class=mid>June 18, 2004</TD> > > > <!-- end --> > > > </TR> > > > > > > Anyway, I won't produce the code for that, because the typical response > is > > > "pointy-haired boss won't let me change the format of the file." So, > > > > > > ... > > > > > > s = ts.ReadAll() > > > ts.close: set ts = nothing > > > > > > s = split(s, VBCrLf) > > > for i = 0 to ubound(s) > > > s(i) = trim(s(i)) > > > bg = instr(s(i), "BGCOLOR") > > > s1 = instr(s(i), "<small>") > > > s2 = instr(s(i), "</small>") > > > if s1 = 1 then response.write "-------<br>" > > > if bg > 0 then > > > if s1 > bg and s2 > s1 then > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > response.write "<br>" > > > end if > > > end if > > > next > > > response.write "-------<br>" > > > > > > > > > > > > -- > > > http://www.aspfaq.com/ > > > (Reverse address to reply.) > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > news:aH******************@bignews3.bellsouth.net.. . > > > > Here is a sample of the file I am importing: > > > > > > > > <small> > > > > <TR> > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> $4,962</small></TD> > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD> > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > > 2004</small></td> > > > > </tr></small> > > > > > > > > > > > > There is additional html before the first <small> that I want
to > ignore. > > I > > > > pretty much want to bring in each piece of information that is within > > that > > > > block of text minus the html codes, for each INSTANCE of that section > > that > > > > appears. > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > >
THE is nothing.
money is money
date is smalldatetime
track is char
pick is char
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... What the heck purpose does the "The" prefix serve? Also, what are the datatypes (is TheMoney a money datatype, a string... is TheDate a
datetime, a string, ...)?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:7c*******************@bignews2.bellsouth.net. .. Columns... TheMoney ThePick TheTrack TheDate
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Of**************@TK2MSFTNGP10.phx.gbl... Now, does co_results have any specific data structure? Just one
column? What is the column called?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:W1*****************@bignews5.bellsouth.net... > Your code returns the following: > > $8,394 > Pick 6 > Bay Meadows > June 10, 2004 > ------- > $7,496 > Pick 6 > Los Alamitos > June 10, 2004 > > I would like to enter the 1st grouping into a db table called co_results. > line 1 is TheMoney field, line 2 is ThePick field, line 3 is
TheTrack field, > and line 4 is TheDate field. > > Then go to the next grouping and insert a new row of data. And on
and on.... > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > news:uq*************@TK2MSFTNGP11.phx.gbl... > > As one string into one column? Separated by what, commas, VBCrLf, HTML > line > > breaks, ...? > > > > BE SPECIFIC. > > > > -- > > http://www.aspfaq.com/ > > (Reverse address to reply.) > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > news:NU**************@bignews6.bellsouth.net... > > > Hmmm....trying to figure out how to insert each block into database > field, > > > themoney,thepick,thetrack,thedate > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
message > > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > > Sheesh, why don't you store information in a database instead
of a > text > > > > file? > > > > > > > > Or have you considered using CSS, and some kind of marker to indicate > a > > > > valid data row? Imagine how much easier it would be if you
had this: > > > > > > > > <crap HTML we don't care about>blah</crap> > > > > <TR> > > > > <!-- start --> > > > > <TD Class=right>$4,962</TD> > > > > <TD Class=mid>Pick 6</TD> > > > > <TD Class=mid>Hastings</TD> > > > > <TD Class=mid>June 12, 2004</TD> > > > > <!-- end --> > > > > </TR> > > > > <TR> > > > > <!-- start --> > > > > <TD Class=right>$200</TD> > > > > <TD Class=mid>Pick 4</TD> > > > > <TD Class=mid>New York</TD> > > > > <TD Class=mid>June 18, 2004</TD> > > > > <!-- end --> > > > > </TR> > > > > > > > > Anyway, I won't produce the code for that, because the typical > response > > is > > > > "pointy-haired boss won't let me change the format of the
file." So, > > > > > > > > ... > > > > > > > > s = ts.ReadAll() > > > > ts.close: set ts = nothing > > > > > > > > s = split(s, VBCrLf) > > > > for i = 0 to ubound(s) > > > > s(i) = trim(s(i)) > > > > bg = instr(s(i), "BGCOLOR") > > > > s1 = instr(s(i), "<small>") > > > > s2 = instr(s(i), "</small>") > > > > if s1 = 1 then response.write "-------<br>" > > > > if bg > 0 then > > > > if s1 > bg and s2 > s1 then > > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > > response.write "<br>" > > > > end if > > > > end if > > > > next > > > > response.write "-------<br>" > > > > > > > > > > > > > > > > -- > > > > http://www.aspfaq.com/ > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > news:aH******************@bignews3.bellsouth.net.. . > > > > > Here is a sample of the file I am importing: > > > > > > > > > > <small> > > > > > <TR> > > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> > $4,962</small></TD> > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD> > > > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Hastings</small></TD> > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > > > 2004</small></td> > > > > > </tr></small> > > > > > > > > > > > > > > > There is additional html before the first <small> that I
want to > > ignore. > > > I > > > > > pretty much want to bring in each piece of information that
is > within > > > that > > > > > block of text minus the html codes, for each INSTANCE of
that > section > > > that > > > > > appears. > > > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Thanks. It is much easier to create a solution when we have actual
specifications!
s = ts.ReadAll()
ts.close: set ts = nothing
prefix = "INSERT co_results(TheMoney, The Pick, TheTrack, TheDate) SELECT "
s = split(s, VBCrLf)
for i = 0 to ubound(s)
s(i) = trim(s(i))
bg = instr(s(i), "BGCOLOR")
s1 = instr(s(i), "<small>")
s2 = instr(s(i), "</small>")
if s1 = 1 then sql = prefix: c = 0
if bg > 0 then
if s1 > bg and s2 > s1 then
c = c + 1
data = mid(s(i), s1+7, s2-(s1+7))
if c > 1 then data = ",'" & replace(data, "'", "''") & "'"
sql = sql & data
end if
end if
if c = 4 then response.write(sql) & "<br>": c = 0
next
If you're happy with the results, change response.write to conn.execute.
And consider demanding that this information come to you in a more usable
way.
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:KH*****************@bignews4.bellsouth.net... THE is nothing. money is money date is smalldatetime track is char pick is char "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:%2****************@tk2msftngp13.phx.gbl... What the heck purpose does the "The" prefix serve? Also, what are the datatypes (is TheMoney a money datatype, a string... is TheDate a datetime, a string, ...)?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:7c*******************@bignews2.bellsouth.net. .. Columns... TheMoney ThePick TheTrack TheDate
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:Of**************@TK2MSFTNGP10.phx.gbl... > Now, does co_results have any specific data structure? Just one column? > What is the column called? > > -- > http://www.aspfaq.com/ > (Reverse address to reply.) > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > news:W1*****************@bignews5.bellsouth.net... > > Your code returns the following: > > > > $8,394 > > Pick 6 > > Bay Meadows > > June 10, 2004 > > ------- > > $7,496 > > Pick 6 > > Los Alamitos > > June 10, 2004 > > > > I would like to enter the 1st grouping into a db table called co_results. > > line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack > field, > > and line 4 is TheDate field. > > > > Then go to the next grouping and insert a new row of data. And on and > on.... > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > news:uq*************@TK2MSFTNGP11.phx.gbl... > > > As one string into one column? Separated by what, commas,
VBCrLf, HTML > > line > > > breaks, ...? > > > > > > BE SPECIFIC. > > > > > > -- > > > http://www.aspfaq.com/ > > > (Reverse address to reply.) > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > news:NU**************@bignews6.bellsouth.net... > > > > Hmmm....trying to figure out how to insert each block into database > > field, > > > > themoney,thepick,thetrack,thedate > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > > > Sheesh, why don't you store information in a database
instead of a > > text > > > > > file? > > > > > > > > > > Or have you considered using CSS, and some kind of marker to > indicate > > a > > > > > valid data row? Imagine how much easier it would be if you had > this: > > > > > > > > > > <crap HTML we don't care about>blah</crap> > > > > > <TR> > > > > > <!-- start --> > > > > > <TD Class=right>$4,962</TD> > > > > > <TD Class=mid>Pick 6</TD> > > > > > <TD Class=mid>Hastings</TD> > > > > > <TD Class=mid>June 12, 2004</TD> > > > > > <!-- end --> > > > > > </TR> > > > > > <TR> > > > > > <!-- start --> > > > > > <TD Class=right>$200</TD> > > > > > <TD Class=mid>Pick 4</TD> > > > > > <TD Class=mid>New York</TD> > > > > > <TD Class=mid>June 18, 2004</TD> > > > > > <!-- end --> > > > > > </TR> > > > > > > > > > > Anyway, I won't produce the code for that, because the
typical > > response > > > is > > > > > "pointy-haired boss won't let me change the format of the file." > So, > > > > > > > > > > ... > > > > > > > > > > s = ts.ReadAll() > > > > > ts.close: set ts = nothing > > > > > > > > > > s = split(s, VBCrLf) > > > > > for i = 0 to ubound(s) > > > > > s(i) = trim(s(i)) > > > > > bg = instr(s(i), "BGCOLOR") > > > > > s1 = instr(s(i), "<small>") > > > > > s2 = instr(s(i), "</small>") > > > > > if s1 = 1 then response.write "-------<br>" > > > > > if bg > 0 then > > > > > if s1 > bg and s2 > s1 then > > > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > > > response.write "<br>" > > > > > end if > > > > > end if > > > > > next > > > > > response.write "-------<br>" > > > > > > > > > > > > > > > > > > > > -- > > > > > http://www.aspfaq.com/ > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > news:aH******************@bignews3.bellsouth.net.. . > > > > > > Here is a sample of the file I am importing: > > > > > > > > > > > > <small> > > > > > > <TR> > > > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> > > $4,962</small></TD> > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick 6</small></TD> > > > > > > > > > > > > <TD BGCOLOR="FFFFFF" > ALIGN="CENTER"><small>Hastings</small></TD> > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > > > > 2004</small></td> > > > > > > </tr></small> > > > > > > > > > > > > > > > > > > There is additional html before the first <small> that I want to > > > ignore. > > > > I > > > > > > pretty much want to bring in each piece of information
that is > > within > > > > that > > > > > > block of text minus the html codes, for each INSTANCE of that > > section > > > > that > > > > > > appears. > > > > > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Aaron,
Where does the 7 come into play?
I downloaded a new copy of the file I am using this code against and each
section is moved over 3 tab spaces.
Old copy:
<small>
<TR>
<TD ALIGN="right" BGCOLOR="82B0A0"><small> $16,102</small></TD>
<TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Tri Super</small></TD>
<TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Ruidoso Downs</small></TD>
<TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>June 10, 2004</small></td>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><A
HREF="eebMultipleProductPurchase.cfm?track_id=RUI" ><IMG
SRC="images/buyproducts.gif" BORDER="0"></A></TD>
</TR></small>
New copy is exactly the same except the whole block is moved over 3 tabs and
the code is no longer bringing it in correctly. I'm hoping the 7 has to do
with it.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl... Thanks. It is much easier to create a solution when we have actual specifications!
s = ts.ReadAll() ts.close: set ts = nothing
prefix = "INSERT co_results(TheMoney, The Pick, TheTrack, TheDate) SELECT
" s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then sql = prefix: c = 0 if bg > 0 then if s1 > bg and s2 > s1 then c = c + 1 data = mid(s(i), s1+7, s2-(s1+7)) if c > 1 then data = ",'" & replace(data, "'", "''") & "'" sql = sql & data end if end if if c = 4 then response.write(sql) & "<br>": c = 0 next If you're happy with the results, change response.write to conn.execute. And consider demanding that this information come to you in a more usable way. -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:KH*****************@bignews4.bellsouth.net... THE is nothing. money is money date is smalldatetime track is char pick is char "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:%2****************@tk2msftngp13.phx.gbl... What the heck purpose does the "The" prefix serve? Also, what are the datatypes (is TheMoney a money datatype, a string... is TheDate a datetime, a string, ...)?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:7c*******************@bignews2.bellsouth.net. .. > Columns... > TheMoney > ThePick > TheTrack > TheDate > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > news:Of**************@TK2MSFTNGP10.phx.gbl... > > Now, does co_results have any specific data structure? Just one column? > > What is the column called? > > > > -- > > http://www.aspfaq.com/ > > (Reverse address to reply.) > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > news:W1*****************@bignews5.bellsouth.net... > > > Your code returns the following: > > > > > > $8,394 > > > Pick 6 > > > Bay Meadows > > > June 10, 2004 > > > ------- > > > $7,496 > > > Pick 6 > > > Los Alamitos > > > June 10, 2004 > > > > > > I would like to enter the 1st grouping into a db table called > co_results. > > > line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack > > field, > > > and line 4 is TheDate field. > > > > > > Then go to the next grouping and insert a new row of data. And
on and > > on.... > > > > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
message > > > news:uq*************@TK2MSFTNGP11.phx.gbl... > > > > As one string into one column? Separated by what, commas, VBCrLf, > HTML > > > line > > > > breaks, ...? > > > > > > > > BE SPECIFIC. > > > > > > > > -- > > > > http://www.aspfaq.com/ > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > news:NU**************@bignews6.bellsouth.net... > > > > > Hmmm....trying to figure out how to insert each block into database > > > field, > > > > > themoney,thepick,thetrack,thedate > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > > > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > > > > Sheesh, why don't you store information in a database instead of a > > > text > > > > > > file? > > > > > > > > > > > > Or have you considered using CSS, and some kind of marker
to > > indicate > > > a > > > > > > valid data row? Imagine how much easier it would be if
you had > > this: > > > > > > > > > > > > <crap HTML we don't care about>blah</crap> > > > > > > <TR> > > > > > > <!-- start --> > > > > > > <TD Class=right>$4,962</TD> > > > > > > <TD Class=mid>Pick 6</TD> > > > > > > <TD Class=mid>Hastings</TD> > > > > > > <TD Class=mid>June 12, 2004</TD> > > > > > > <!-- end --> > > > > > > </TR> > > > > > > <TR> > > > > > > <!-- start --> > > > > > > <TD Class=right>$200</TD> > > > > > > <TD Class=mid>Pick 4</TD> > > > > > > <TD Class=mid>New York</TD> > > > > > > <TD Class=mid>June 18, 2004</TD> > > > > > > <!-- end --> > > > > > > </TR> > > > > > > > > > > > > Anyway, I won't produce the code for that, because the
typical > > > response > > > > is > > > > > > "pointy-haired boss won't let me change the format of the file." > > So, > > > > > > > > > > > > ... > > > > > > > > > > > > s = ts.ReadAll() > > > > > > ts.close: set ts = nothing > > > > > > > > > > > > s = split(s, VBCrLf) > > > > > > for i = 0 to ubound(s) > > > > > > s(i) = trim(s(i)) > > > > > > bg = instr(s(i), "BGCOLOR") > > > > > > s1 = instr(s(i), "<small>") > > > > > > s2 = instr(s(i), "</small>") > > > > > > if s1 = 1 then response.write "-------<br>" > > > > > > if bg > 0 then > > > > > > if s1 > bg and s2 > s1 then > > > > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > > > > response.write "<br>" > > > > > > end if > > > > > > end if > > > > > > next > > > > > > response.write "-------<br>" > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > http://www.aspfaq.com/ > > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > > news:aH******************@bignews3.bellsouth.net.. . > > > > > > > Here is a sample of the file I am importing: > > > > > > > > > > > > > > <small> > > > > > > > <TR> > > > > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> > > > $4,962</small></TD> > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick > 6</small></TD> > > > > > > > > > > > > > > <TD BGCOLOR="FFFFFF" > > ALIGN="CENTER"><small>Hastings</small></TD> > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > > > > > 2004</small></td> > > > > > > > </tr></small> > > > > > > > > > > > > > > > > > > > > > There is additional html before the first <small> that I want to > > > > ignore. > > > > > I > > > > > > > pretty much want to bring in each piece of information that is > > > within > > > > > that > > > > > > > block of text minus the html codes, for each INSTANCE of that > > > section > > > > > that > > > > > > > appears. > > > > > > > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Maybe you could show the NEW copy instead of the OLD copy?
-- http://www.aspfaq.com/
(Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message
news:fy**************@bignews6.bellsouth.net... Aaron,
Where does the 7 come into play? I downloaded a new copy of the file I am using this code against and each section is moved over 3 tab spaces.
Old copy: <small> <TR> <TD ALIGN="right" BGCOLOR="82B0A0"><small> $16,102</small></TD> <TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Tri Super</small></TD>
<TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Ruidoso Downs</small></TD> <TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>June 10, 2004</small></td>
<TD BGCOLOR="FFFFFF" ALIGN="CENTER"><A HREF="eebMultipleProductPurchase.cfm?track_id=RUI" ><IMG SRC="images/buyproducts.gif" BORDER="0"></A></TD>
</TR></small>
New copy is exactly the same except the whole block is moved over 3 tabs
and the code is no longer bringing it in correctly. I'm hoping the 7 has to do with it.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:u9**************@TK2MSFTNGP11.phx.gbl... Thanks. It is much easier to create a solution when we have actual specifications!
s = ts.ReadAll() ts.close: set ts = nothing
prefix = "INSERT co_results(TheMoney, The Pick, TheTrack, TheDate)
SELECT " s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then sql = prefix: c = 0 if bg > 0 then if s1 > bg and s2 > s1 then c = c + 1 data = mid(s(i), s1+7, s2-(s1+7)) if c > 1 then data = ",'" & replace(data, "'", "''") & "'" sql = sql & data end if end if if c = 4 then response.write(sql) & "<br>": c = 0 next If you're happy with the results, change response.write to conn.execute. And consider demanding that this information come to you in a more
usable way. -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:KH*****************@bignews4.bellsouth.net... THE is nothing. money is money date is smalldatetime track is char pick is char "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:%2****************@tk2msftngp13.phx.gbl... > What the heck purpose does the "The" prefix serve? Also, what are
the > datatypes (is TheMoney a money datatype, a string... is TheDate a datetime, > a string, ...)? > > -- > http://www.aspfaq.com/ > (Reverse address to reply.) > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > news:7c*******************@bignews2.bellsouth.net. .. > > Columns... > > TheMoney > > ThePick > > TheTrack > > TheDate > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > news:Of**************@TK2MSFTNGP10.phx.gbl... > > > Now, does co_results have any specific data structure? Just one column? > > > What is the column called? > > > > > > -- > > > http://www.aspfaq.com/ > > > (Reverse address to reply.) > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > news:W1*****************@bignews5.bellsouth.net... > > > > Your code returns the following: > > > > > > > > $8,394 > > > > Pick 6 > > > > Bay Meadows > > > > June 10, 2004 > > > > ------- > > > > $7,496 > > > > Pick 6 > > > > Los Alamitos > > > > June 10, 2004 > > > > > > > > I would like to enter the 1st grouping into a db table called > > co_results. > > > > line 1 is TheMoney field, line 2 is ThePick field, line 3 is TheTrack > > > field, > > > > and line 4 is TheDate field. > > > > > > > > Then go to the next grouping and insert a new row of data. And on and > > > on.... > > > > > > > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > > > news:uq*************@TK2MSFTNGP11.phx.gbl... > > > > > As one string into one column? Separated by what, commas,
VBCrLf, > > HTML > > > > line > > > > > breaks, ...? > > > > > > > > > > BE SPECIFIC. > > > > > > > > > > -- > > > > > http://www.aspfaq.com/ > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > news:NU**************@bignews6.bellsouth.net... > > > > > > Hmmm....trying to figure out how to insert each block into > database > > > > field, > > > > > > themoney,thepick,thetrack,thedate > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > > > > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > > > > > Sheesh, why don't you store information in a database instead of > a > > > > text > > > > > > > file? > > > > > > > > > > > > > > Or have you considered using CSS, and some kind of
marker to > > > indicate > > > > a > > > > > > > valid data row? Imagine how much easier it would be if you had > > > this: > > > > > > > > > > > > > > <crap HTML we don't care about>blah</crap> > > > > > > > <TR> > > > > > > > <!-- start --> > > > > > > > <TD Class=right>$4,962</TD> > > > > > > > <TD Class=mid>Pick 6</TD> > > > > > > > <TD Class=mid>Hastings</TD> > > > > > > > <TD Class=mid>June 12, 2004</TD> > > > > > > > <!-- end --> > > > > > > > </TR> > > > > > > > <TR> > > > > > > > <!-- start --> > > > > > > > <TD Class=right>$200</TD> > > > > > > > <TD Class=mid>Pick 4</TD> > > > > > > > <TD Class=mid>New York</TD> > > > > > > > <TD Class=mid>June 18, 2004</TD> > > > > > > > <!-- end --> > > > > > > > </TR> > > > > > > > > > > > > > > Anyway, I won't produce the code for that, because the typical > > > > response > > > > > is > > > > > > > "pointy-haired boss won't let me change the format of
the file." > > > So, > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > s = ts.ReadAll() > > > > > > > ts.close: set ts = nothing > > > > > > > > > > > > > > s = split(s, VBCrLf) > > > > > > > for i = 0 to ubound(s) > > > > > > > s(i) = trim(s(i)) > > > > > > > bg = instr(s(i), "BGCOLOR") > > > > > > > s1 = instr(s(i), "<small>") > > > > > > > s2 = instr(s(i), "</small>") > > > > > > > if s1 = 1 then response.write "-------<br>" > > > > > > > if bg > 0 then > > > > > > > if s1 > bg and s2 > s1 then > > > > > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > > > > > response.write "<br>" > > > > > > > end if > > > > > > > end if > > > > > > > next > > > > > > > response.write "-------<br>" > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > http://www.aspfaq.com/ > > > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > > > news:aH******************@bignews3.bellsouth.net.. . > > > > > > > > Here is a sample of the file I am importing: > > > > > > > > > > > > > > > > <small> > > > > > > > > <TR> > > > > > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> > > > > $4,962</small></TD> > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick > > 6</small></TD> > > > > > > > > > > > > > > > > <TD BGCOLOR="FFFFFF" > > > ALIGN="CENTER"><small>Hastings</small></TD> > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June
12, > > > > > > 2004</small></td> > > > > > > > > </tr></small> > > > > > > > > > > > > > > > > > > > > > > > > There is additional html before the first <small> that
I want > to > > > > > ignore. > > > > > > I > > > > > > > > pretty much want to bring in each piece of information that is > > > > within > > > > > > that > > > > > > > > block of text minus the html codes, for each INSTANCE
of that > > > > section > > > > > > that > > > > > > > > appears. > > > > > > > > > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Aaron,
I figured it out. I just had to add a replace and remove the additional
spaces it added. It's working. I thank you for all the help!
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uX*************@TK2MSFTNGP10.phx.gbl... Maybe you could show the NEW copy instead of the OLD copy?
-- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:fy**************@bignews6.bellsouth.net... Aaron,
Where does the 7 come into play? I downloaded a new copy of the file I am using this code against and
each section is moved over 3 tab spaces.
Old copy: <small> <TR> <TD ALIGN="right" BGCOLOR="82B0A0"><small> $16,102</small></TD> <TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Tri Super</small></TD>
<TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>Ruidoso
Downs</small></TD> <TD BGCOLOR="82B0A0" ALIGN="CENTER"><small>June 10,
2004</small></td> <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><A HREF="eebMultipleProductPurchase.cfm?track_id=RUI" ><IMG SRC="images/buyproducts.gif" BORDER="0"></A></TD>
</TR></small>
New copy is exactly the same except the whole block is moved over 3 tabs and the code is no longer bringing it in correctly. I'm hoping the 7 has to
do with it.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:u9**************@TK2MSFTNGP11.phx.gbl... Thanks. It is much easier to create a solution when we have actual specifications!
s = ts.ReadAll() ts.close: set ts = nothing
prefix = "INSERT co_results(TheMoney, The Pick, TheTrack, TheDate) SELECT " s = split(s, VBCrLf) for i = 0 to ubound(s) s(i) = trim(s(i)) bg = instr(s(i), "BGCOLOR") s1 = instr(s(i), "<small>") s2 = instr(s(i), "</small>") if s1 = 1 then sql = prefix: c = 0 if bg > 0 then if s1 > bg and s2 > s1 then c = c + 1 data = mid(s(i), s1+7, s2-(s1+7)) if c > 1 then data = ",'" & replace(data, "'", "''") & "'" sql = sql & data end if end if if c = 4 then response.write(sql) & "<br>": c = 0 next If you're happy with the results, change response.write to
conn.execute. And consider demanding that this information come to you in a more
usable way. -- http://www.aspfaq.com/ (Reverse address to reply.)
"Joey Martin" <jo**@infosmiths.net> wrote in message news:KH*****************@bignews4.bellsouth.net... > THE is nothing. > money is money > date is smalldatetime > track is char > pick is char > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > news:%2****************@tk2msftngp13.phx.gbl... > > What the heck purpose does the "The" prefix serve? Also, what are the > > datatypes (is TheMoney a money datatype, a string... is TheDate a > datetime, > > a string, ...)? > > > > -- > > http://www.aspfaq.com/ > > (Reverse address to reply.) > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > news:7c*******************@bignews2.bellsouth.net. .. > > > Columns... > > > TheMoney > > > ThePick > > > TheTrack > > > TheDate > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
message > > > news:Of**************@TK2MSFTNGP10.phx.gbl... > > > > Now, does co_results have any specific data structure? Just
one > column? > > > > What is the column called? > > > > > > > > -- > > > > http://www.aspfaq.com/ > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > news:W1*****************@bignews5.bellsouth.net... > > > > > Your code returns the following: > > > > > > > > > > $8,394 > > > > > Pick 6 > > > > > Bay Meadows > > > > > June 10, 2004 > > > > > ------- > > > > > $7,496 > > > > > Pick 6 > > > > > Los Alamitos > > > > > June 10, 2004 > > > > > > > > > > I would like to enter the 1st grouping into a db table
called > > > co_results. > > > > > line 1 is TheMoney field, line 2 is ThePick field, line 3 is > TheTrack > > > > field, > > > > > and line 4 is TheDate field. > > > > > > > > > > Then go to the next grouping and insert a new row of data.
And on > and > > > > on.... > > > > > > > > > > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message > > > > > news:uq*************@TK2MSFTNGP11.phx.gbl... > > > > > > As one string into one column? Separated by what, commas, VBCrLf, > > > HTML > > > > > line > > > > > > breaks, ...? > > > > > > > > > > > > BE SPECIFIC. > > > > > > > > > > > > -- > > > > > > http://www.aspfaq.com/ > > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > > news:NU**************@bignews6.bellsouth.net... > > > > > > > Hmmm....trying to figure out how to insert each block
into > > database > > > > > field, > > > > > > > themoney,thepick,thetrack,thedate > > > > > > > "Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote
in > message > > > > > > > news:Oa**************@TK2MSFTNGP10.phx.gbl... > > > > > > > > Sheesh, why don't you store information in a database instead > of > > a > > > > > text > > > > > > > > file? > > > > > > > > > > > > > > > > Or have you considered using CSS, and some kind of marker to > > > > indicate > > > > > a > > > > > > > > valid data row? Imagine how much easier it would be
if you > had > > > > this: > > > > > > > > > > > > > > > > <crap HTML we don't care about>blah</crap> > > > > > > > > <TR> > > > > > > > > <!-- start --> > > > > > > > > <TD Class=right>$4,962</TD> > > > > > > > > <TD Class=mid>Pick 6</TD> > > > > > > > > <TD Class=mid>Hastings</TD> > > > > > > > > <TD Class=mid>June 12, 2004</TD> > > > > > > > > <!-- end --> > > > > > > > > </TR> > > > > > > > > <TR> > > > > > > > > <!-- start --> > > > > > > > > <TD Class=right>$200</TD> > > > > > > > > <TD Class=mid>Pick 4</TD> > > > > > > > > <TD Class=mid>New York</TD> > > > > > > > > <TD Class=mid>June 18, 2004</TD> > > > > > > > > <!-- end --> > > > > > > > > </TR> > > > > > > > > > > > > > > > > Anyway, I won't produce the code for that, because the typical > > > > > response > > > > > > is > > > > > > > > "pointy-haired boss won't let me change the format of the > file." > > > > So, > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > s = ts.ReadAll() > > > > > > > > ts.close: set ts = nothing > > > > > > > > > > > > > > > > s = split(s, VBCrLf) > > > > > > > > for i = 0 to ubound(s) > > > > > > > > s(i) = trim(s(i)) > > > > > > > > bg = instr(s(i), "BGCOLOR") > > > > > > > > s1 = instr(s(i), "<small>") > > > > > > > > s2 = instr(s(i), "</small>") > > > > > > > > if s1 = 1 then response.write "-------<br>" > > > > > > > > if bg > 0 then > > > > > > > > if s1 > bg and s2 > s1 then > > > > > > > > response.write mid(s(i), s1+7, s2-(s1+7)) > > > > > > > > response.write "<br>" > > > > > > > > end if > > > > > > > > end if > > > > > > > > next > > > > > > > > response.write "-------<br>" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > http://www.aspfaq.com/ > > > > > > > > (Reverse address to reply.) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "Joey Martin" <jo**@infosmiths.net> wrote in message > > > > > > > > news:aH******************@bignews3.bellsouth.net.. . > > > > > > > > > Here is a sample of the file I am importing: > > > > > > > > > > > > > > > > > > <small> > > > > > > > > > <TR> > > > > > > > > > <TD ALIGN="right" BGCOLOR="FFFFFF"><small> > > > > > $4,962</small></TD> > > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>Pick > > > 6</small></TD> > > > > > > > > > > > > > > > > > > <TD BGCOLOR="FFFFFF" > > > > ALIGN="CENTER"><small>Hastings</small></TD> > > > > > > > > > <TD BGCOLOR="FFFFFF" ALIGN="CENTER"><small>June 12, > > > > > > > 2004</small></td> > > > > > > > > > </tr></small> > > > > > > > > > > > > > > > > > > > > > > > > > > > There is additional html before the first <small>
that I > want > > to > > > > > > ignore. > > > > > > > I > > > > > > > > > pretty much want to bring in each piece of
information that > is > > > > > within > > > > > > > that > > > > > > > > > block of text minus the html codes, for each
INSTANCE of > that > > > > > section > > > > > > > that > > > > > > > > > appears. > > > > > > > > > > > > > > > > > > Thanks for the help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ryan |
last post by:
I'm struggling with a Case statement. The problem I has is with doing
>= I can use any value in there, but need to check if it's greater or
equal to 1. I'm sure I'm missing something but can't...
|
by: Tim Graichen |
last post by:
Could somebody please help me out with this easy one? I have a five button
toggle set up. Case 1-4 work fine, so I have ommitted the code from this
post. I need help with Case 5.
Case five...
|
by: Terencetrent |
last post by:
I having been using Access '97/2002 for about 4 years now and have
never really had the need or the time to learn visual basic. Well, I
think the time has finally come.
I need help with Visual...
|
by: esil |
last post by:
Can anybody help me with this query? All other fields are correct except UsageStock field...
select Sum(Case when ='7' then (++) else 0 end) AS ProjUsageClear,
Sum(Case when ='7' then else 0...
|
by: bob |
last post by:
Now this ought to be a simple matter. But nothing's simple in the Net
world, I'm finding.
In vb6 you could use "!" to force text to upper case in the format
function. I've searched the vb.net...
|
by: Frederick Dean |
last post by:
Hi,guys!
I'm reading Stephen Dewhurst's book "C++ Gotchas"£¬in gothca #7, I
meet a weird case:
bool Postorder::next() {
switch (pc)
case START:
while (true)
if (!child()) {
pc = LEAF;
return...
|
by: Adam |
last post by:
Hello. I do most of my web dev work from a Mac (whose file system is
case-insensitive.) I upload my web pages and other files onto a
Unix-based host, which is case sensitive.
When I look at the...
|
by: emalcolm_FLA |
last post by:
Hello and Thanks in advance for any help.
I have been tasked with rewriting a christmas assistance database
using Access 2003. The old system used pre-assigned case numbers to
identify...
|
by: Desitech |
last post by:
I have a table entitled "Parts". In that table I have a field entitled "PartDoc" and four fields entitled "Product1", Product2", "Product3", and Product4". The datatype for these fields is Number...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |