Question need to get first line with the lottery numbers from html text

inkedgfx

Well-known member
Joined
Sep 29, 2012
Messages
139
Location
USA
Programming Experience
Beginner
I am having a difficult time getting the most recent winning numbers from the lottery website....I have some code that will get the html from the site , the problem I am having is ....I dont know how or where to start to get the exact line of numbers I need...the line will change twice a week.....but it will always be the first line with the numbers in it..... example of the text I need to extract the numbers from below.....the first line with the date and numbers is what I am after.....

FLORIDA LOTTERY Winning Numbers History


11-JAN-2013 Page 1 of 20


Please note every effort has been made to ensure that the enclosed information is accurate; however, in the event of an error, the winning numbers in the official record of the Florida Lottery shall be controlling.




FLORIDA LOTTO


--------------------------------------------------------------------------------

------> 01/09/13 19 - 20 - 24 - 27 - 42 - 51 X4 <--------- this is the line I need.........07/18/12 1 - 3 - 7 - 23 - 33 - 44 X5
01/05/13 8 - 19 - 21 - 23 - 36 - 40 X4 07/14/12 8 - 19 - 31 - 37 - 41 - 51 X5

01/02/13 9 - 17 - 27 - 44 - 48 - 51 X2 07/11/12 16 - 19 - 26 - 31 - 39 - 50 X3
12/29/12 15 - 18 - 21 - 31 - 40 - 41 X2 07/07/12 2 - 6 - 17 - 26 - 31 - 40 X3

12/26/12 1 - 6 - 22 - 24 - 32 - 48 X5 07/04/12 7 - 11 - 21 - 28 - 43 - 46 X4

I appreciate the help.....again

InkedGFX
 
ok maybe you need more info....sorry about that.... this is what I need to parse

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html>
< head>
< meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
< title></title>
< /head>
< body dir="LTR" bgcolor="#ffffff">
< !-- Created by Oracle Reports 04:00 Fri Jan 11 04:00:30 AM, 2013 -->
< table border=0 cellspacing=0 cellpadding=0 width=774>
< tr><td width=15></td><td width=1></td><td width=9></td><td width=39></td><td width=46></td><td width=13></td><td width=13></td><td width=1></td><td width=9></td><td width=5></td><td width=12></td><td width=1></td><td width=10></td><td width=5></td><td width=10></td><td width=4></td><td width=1></td><td width=10></td><td width=4></td><td width=14></td><td width=1></td><td width=2></td><td width=8></td><td width=5></td><td width=13></td><td width=1></td><td width=11></td><td width=3></td><td width=16></td><td width=17></td><td width=14></td><td width=115></td><td width=10></td><td width=36></td><td width=13></td><td width=13></td><td width=1></td><td width=9></td><td width=4></td><td width=13></td><td width=1></td><td width=10></td><td width=4></td><td width=10></td><td width=5></td><td width=1></td><td width=10></td><td width=4></td><td width=14></td><td width=1></td><td width=10></td><td width=5></td><td width=13></td><td width=1></td><td width=11></td><td width=3></td><td width=16></td><td width=16></td><td width=14></td><td width=63></td><td width=10></td><td width=6></td><td width=19></td></tr>
< tr><td colspan=63 height=9></td></tr>
< tr valign=top>
<td height=9></td>
<td width=210 colspan=21 rowspan=2><font face="helvetica" color="#007f7f"><b>FLORIDA LOTTERY</b></font></td>
<td colspan=11></td>
<td width=301 colspan=27 rowspan=2 align=right><font face="helvetica" color="#007f7f"><b>Winning Numbers History</b></font></td>
<td colspan=3></td>
< /tr>
< tr valign=top>
<td height=9></td>
<td colspan=11></td>
<td colspan=3></td>
< /tr>
< tr><td colspan=63 height=9></td></tr>
< tr valign=top>
<td height=9></td>
<td width=174 colspan=14 rowspan=2><font face="helvetica" color="#007f7f"><b>11-JAN-2013</b></font></td>
<td colspan=29></td>
<td width=187 colspan=16 rowspan=2 align=right> <font face="helvetica" color="#007f7f"><b>Page </b></font><font face="helvetica" color="#007f7f"><b>1</b></font><font face="helvetica" color="#007f7f"><b> of </b></font><font face="helvetica" color="#007f7f"><b>20</b></font><br></td>
<td colspan=3></td>
< /tr>
< tr valign=top>
<td height=9></td>
<td colspan=29></td>
<td colspan=3></td>
< /tr>
< tr valign=top>
<td height=9 colspan=3></td>
<td width=730 colspan=59 rowspan=3> <font size=2 face="helvetica">Please note every effort has been made to ensure that the enclosed information is accurate; however, in the event of an error, the winning  numbers in the official record of the Florida Lottery shall be controlling.</font><br></td>
<td></td>
< /tr>
< tr valign=top>
<td height=9 colspan=3></td>
<td></td>
< /tr>
< tr valign=top>
<td height=9 colspan=3></td>
<td></td>
< /tr>
< tr><td colspan=63 height=9></td></tr>
< tr valign=top>
<td height=9 colspan=2></td>
<td width=733 colspan=59 rowspan=2 align=center><font face="helvetica"><b>FLORIDA LOTTO</b></font></td>
<td colspan=2></td>
< /tr>
< tr valign=top>
<td height=9 colspan=2></td>
<td colspan=2></td>
< /tr>
< tr valign=top>
<td height=9 colspan=2></td>
<td colspan=59><hr size=1 noshade></td>
<td colspan=2></td>
< /tr>
< tr valign=top>
<td height=9 colspan=4></td>
<td width=46><font size=2 face="helvetica">01/09/13</font></td><-------- I need this date and the numbers following this date
<td></td>
<td width=13 align=right><font size=2 face="helvetica">19</font></td>><-------- I need this number
<td></td>
<td width=9 align=right><font size=2 face="helvetica">-</font></td>>
<td></td>
<td width=12 align=right><font size=2 face="helvetica">20</font></td>><-------- I need this number
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 colspan=2 align=right><font size=2 face="helvetica">24</font></td>><-------- I need this number
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">27</font></td>><-------- I need this number
<td></td>
<td width=10 colspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">42</font></td>><-------- I need this number
<td></td>
<td width=11 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 align=right><font size=2 face="helvetica">51</font></td>><-------- I need this number
<td></td>

I have tried to use Mid and if line.contains("=46") but nothing works...I know i'm doing it wrong....I need some help here.......also this date and numbers will change twice a week, but they will always be in the first line as they are here.

thanks

InkedGFX
 
Hi,

Here is one way to do this using RegEx. You will need a TextBox and a Button on a new form:-

VB.NET:
Imports System.IO
Imports System.Text.RegularExpressions
 
Public Class Form1
  Private HTMLString As String
 
  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Using myReader As New StreamReader("d:\temp\HTMLText.txt")
      HTMLString = myReader.ReadToEnd
      myReader.Close()
    End Using
  End Sub
 
  Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    'define the regular expressions to match date and numbers
    Dim myDateMatcher As New Regex("[0-9][0-9]/[0-9][0-9]/[0-9][0-9]")
    Dim myNumberMatcher As New Regex(">[0-9][0-9]<")
 
    'get the date match and save it
    Dim myDateMatches As MatchCollection = myDateMatcher.Matches(HTMLString)
    For Each DateMatch As Match In myDateMatches
      TextBox1.Text = DateMatch.Value & vbCrLf
    Next
 
    'split the date match and then use the sceond element of the array to match the numbers
    Dim myDateSplit() As String = myDateMatcher.Split(HTMLString)
    Dim myNumberMatches As MatchCollection = myNumberMatcher.Matches(myDateSplit(1))
    'get the number matchs and save them
    For Each MatchedNumber As Match In myNumberMatches
      TextBox1.Text += MatchedNumber.Value.Substring(1, 2) & vbCrLf
    Next
  End Sub
End Class

You can ignore my Load Event, this is just getting your data from a file on my local drive. As you will see, this is just a case of finding the right combination of characters to match and split against.

Hope that helps.

Cheers,

Ian
 
thank you very much for your help....this code works but it gets the last date in the list and first line of numbers on the page.....I need to get the first date and the corresponding numbers to that date......the page I am trying to parse is the lottery numbers history page which has all the numbers from the beggining of the lottery games....so there are alot of dates and numbers.

I don't see another way of doing this because the lottery website is always changing .....so I will always have to update the code to find the date and numbers of the most recent drawing..but the history page doesn't change, so by useing the history page , I wouldnt have to update or change the code.....

how would I get the first date and numbers in the htmlstring?

Thank You
InkedGFX
 
Last edited:
Hi,

this code works but it gets the last date in the list and first line of numbers on the page

Errrr....Sorry? What I provided was a solution to what you posted as your returned HTML page from the site. After reading your last post however, I guess that this is not an example of what you truly want to interrogate?

Please provide a better example of what you need to work with, specifying exactly which date and lottery numbers you are after, and we will see if we can guide you better.

Cheers,

Ian
 
Thank You for the help.....

the numbers and dates are here http://www.flalottery.com/exptkt/l6.htm the list is to long to put in this post.....what I want is the most recent date and corresponding numbers...keep in mind these will change twice a week....but the most recent date and numers will always be the first date and set of numbers ......I already have the code to get the source from the page but really can't figure out how to get the date and numbers from it and put the numbers in a label....is there a way to do this without adding another form and textbox...I have a form with the date lable and the numbers label, I would like to use them if at all possible.

thank You
InkedGFX
 
Hi,

I am not able to access that web site at the moment so I must assume that it's down for some reason? I will have a look again in the morning and give you my thoughts if no one else has responded in the meantime.

Ian
 
Hi,

Have tried again this morning and there is still no response from this website??? On that basis I cannot help with anything specific. However, and without knowing the exact structure of the HTML source file, it would seem to me that a combination of Match, Split, Loop and If statements is going to achieve what you are looking for.

If you still need further help on this then you will need to post a more specific example of the HTML source from the page that you are interrogating.

Hope that helps.

Cheers,

Ian
 
here is a sample of the html I need to parse ..the html is alot longer than this ..there is 20 pages worth of numbers in one html page , this is the first page....

FLORIDA LOTTERYWinning Numbers History
12-JAN-2013Page 1 of 20
Please note every effort has been made to ensure that the enclosed information is accurate; however, in the event of an error, the winning
numbers in the official record of the Florida Lottery shall be controlling.

FLORIDA LOTTO


01/09/1319-20-24-27-42-51X407/18/121-3-7-23-33-44X5
01/05/138-19-21-23-36-40X407/14/128-19-31-37-41-51X5
01/02/139-17-27-44-48-51X207/11/1216-19-26-31-39-50X3
12/29/1215-18-21-31-40-41X207/07/122-6-17-26-31-40X3
12/26/121-6-22-24-32-48X507/04/127-11-21-28-43-46X4
12/22/1218-20-35-36-37-39X206/30/1213-26-50-51-52-53X4
12/19/1225-29-37-38-44-45X306/27/122-7-18-29-35-44X4
12/15/1213-28-30-32-38-40X406/23/125-7-10-24-28-43X3
12/12/1217-33-34-41-49-53X406/20/124-8-20-24-35-43X4
12/08/123-7-8-28-29-53X306/16/125-7-15-30-46-48X2
12/05/126-20-25-36-44-52X306/13/121-2-21-42-45-49X3
12/01/122-5-33-45-48-50X306/09/1213-22-27-36-43-52X5
11/28/127-12-15-20-34-49X506/06/124-12-14-26-36-46X5
11/24/1226-28-36-41-50-51X406/02/126-8-15-22-47-50X4
11/21/123-19-24-34-37-41X205/30/124-6-19-20-38-48X2
11/17/125-14-19-30-49-52X205/26/1215-23-30-48-49-52X4
11/14/1210-12-19-48-49-53X405/23/125-6-9-23-30-41X4
11/10/128-15-18-42-45-50X205/19/125-10-14-17-28-33X2
11/07/127-11-15-18-24-43X505/16/122-27-43-44-47-52X5
11/03/1210-16-21-23-41-44X205/12/123-14-17-32-33-34X2
10/31/122-17-34-36-43-52X205/09/121-6-14-17-21-34X2
10/27/121-2-29-30-31-35X505/05/122-13-20-26-45-53X5
10/24/128-11-21-26-28-38X505/02/1212-20-22-32-34-41X2
10/20/1216-25-26-27-40-53X304/28/124-11-13-17-20-28X3
10/17/122-9-16-18-34-46X304/25/127-11-39-46-50-53X4
10/13/124-11-36-37-45-51X304/21/121-15-22-27-31-43X2
10/10/1211-19-29-31-37-50X404/18/121-5-12-19-32-44X3
10/06/125-12-19-30-41-48X204/14/121-3-22-28-36-40X2
10/03/1213-14-25-26-37-39X504/11/1211-34-43-45-46-51X2
09/29/1210-15-21-28-35-41X304/07/127-14-16-23-36-43X3
09/26/121-3-16-19-25-38X404/04/124-15-26-28-35-47X5
09/22/1213-19-30-43-46-51X303/31/121-15-17-23-31-33X2
09/19/125-7-12-22-31-53X303/28/1213-18-24-33-37-50X2
09/15/125-12-21-24-51-53X503/24/121-12-25-33-35-42X3
09/12/122-6-7-11-21-41X403/21/122-3-4-10-18-26X2
09/08/1214-21-27-31-45-52X203/17/1230-38-39-43-44-49X5
09/05/1223-28-29-36-37-46X303/14/121-10-17-19-22-31X5
09/01/122-8-23-27-43-53X503/10/127-14-19-31-48-52X5
08/29/121-28-36-39-44-47X203/07/125-9-18-31-44-48X4
08/25/121-18-23-27-33-36X403/03/125-8-9-16-20-45X3
08/22/1214-29-30-41-43-49X502/29/126-20-27-33-42-45X3
08/18/124-26-39-42-45-47X502/25/121-2-6-14-19-31X5
08/15/123-7-10-19-24-27X202/22/126-12-17-21-26-42X3
08/11/125-13-32-45-47-48X502/18/127-18-37-41-45-51X5
08/08/126-9-18-32-39-49X402/15/1229-37-38-39-42-44X2
08/04/122-26-36-37-40-43X302/11/121-8-11-20-47-52X5
08/01/1222-27-31-38-39-42X202/08/123-12-20-22-31-52X2
07/28/123-8-9-12-33-52X502/04/129-16-34-39-41-46X2
07/25/124-19-30-46-49-53X502/01/1215-23-38-48-52-53X3
07/21/1210-14-15-31-34-50X501/28/1220-32-34-41-42-45X3

thanks for your help.

InkedGFX
 
Hi,

The first thing to say is that this is not a HTML file. This looks more like what the web page is displaying. Am I right? The first thing you need to decide on then is whether you are parsing a HTML file or the formatted web page?

Once you have done that, what have you tried based on my previous comments and example? From what I can see you already have all the code and techniques that you need to solve this? It just needs modifying to the correct RegEx expressions with the correct loops to accommodate multiple dates and multiple numbers.

Cheers,

Ian
 
yes , that is the display , not the html...sorry about that....my 2nd post has the html code that i need to parse to get the date and numbers of the most recent lottery drawing.....the regex gets all the dates and numbers? correct?

what i need is only the most recent drawing which will be the first date and numbers ....which is the first line with the date and numbers...there are alot of dates and numbers in the html code of the history page....so I couldn't post it all. is there a regex code that will get the first instance of the date and numbers then stop?

thanks for your help

InkedGFX
 
Are you winding us up or what?? How on earth is anyone supposed to help you when you post incorrect and misleading information?

So, now you have confirmed that you are parsing the HTML of the page, you now say this:-

the regex gets all the dates and numbers? correct?

What are the question marks for? You would know this if you had tried anything and we cannot answer the question since you have NEVER posted any information with more than ONE lottery date and ONE set of numbers.

Give it a try for yourself, (Hint, look up Exit For on the Net), and if you need to ask anymore questions then I suggest that you try and be a bit more specific and detailed with what you post.

Cheers,

Ian
 
How am I winding you up? and what is mosleading about what I posted......I asked if there is away to get the first line with the most recent date and numbers from the html source......

I have tried it ...like I said , the code you helped me with gets the first numbers and the last date.......if I knew how to do this I wouldnt be asking for help....

thanks for your help

InkedGFX
 
OK, I am a patient man so I will try and say this a calmly as possible.

1)
"What's misleading about what I posted"
When Parsing a string of data, it is crucial to provide the data that needs to be parsed so that someone can define a routine that correctly interrogates the information that needs to be parsed. To post a Web Page layout that has nothing to do with the HTML structure of the string to be parsed is NONSENSE and just raises additional questions as to what needs to be done to solve your issue:- i.e, my previous post and needless questions!

2) "
I have tried it ...like I said , the code you helped me with gets the first numbers and the last date......."
As previously said, the code I wrote is based on the HTML file that you have provided, even until now. On the basis that you have STILL not provided a more comprehensive example of what you are trying to parse then there is nothing I, or anyone else, can do to help you with to parse that HTML string. I certainly do not have a Crystal Ball?

3)
"if I knew how to do this I wouldn't be asking for help...."
What do you know about programming and parsing strings etc...?? I will happily take my time to help you overcome any problems that you have in your coding but please understand that I am NOT going to sit here and write all your solutions for you based on your needs while you sit there learning nothing.

4) I will ask the same question again, What have you tried based on the information you have been given so far? You have not even attempted to answer this so I guess you have still not even attempted to try this for yourself??

This will be my last post on this thread until you have attempted to try something yourself. I am still happy to help but you need to prove, not only to me but to yourself, that you have tried to give this a go.

Ian
 
let me start out by apologizing...by no means did I try to wind you up...I know you are trying to help me out......I don't expect you to do the code for me ....

I tried to post the html code earlier but there was to much to post , so I posted a link(which you could get to work). I will post some of the html code here but like I said earlier ...the forum won't let me post very much of it......below is part of the html code I need to parse......

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
</head>
<body dir="LTR" bgcolor="#ffffff">
<!-- Created by Oracle Reports 04:00 Sun Jan 13 04:00:30 AM, 2013 -->
<table border=0 cellspacing=0 cellpadding=0 width=774>
<tr><td width=15></td><td width=1></td><td width=9></td><td width=39></td><td width=46></td><td width=13></td><td width=13></td><td width=1></td><td width=9></td><td width=5></td><td width=12></td><td width=1></td><td width=10></td><td width=5></td><td width=10></td><td width=4></td><td width=1></td><td width=10></td><td width=4></td><td width=14></td><td width=1></td><td width=2></td><td width=8></td><td width=5></td><td width=13></td><td width=1></td><td width=11></td><td width=3></td><td width=16></td><td width=17></td><td width=14></td><td width=115></td><td width=10></td><td width=36></td><td width=13></td><td width=13></td><td width=1></td><td width=9></td><td width=4></td><td width=13></td><td width=1></td><td width=10></td><td width=4></td><td width=10></td><td width=5></td><td width=1></td><td width=10></td><td width=4></td><td width=14></td><td width=1></td><td width=10></td><td width=5></td><td width=13></td><td width=1></td><td width=11></td><td width=3></td><td width=16></td><td width=16></td><td width=14></td><td width=63></td><td width=10></td><td width=6></td><td width=19></td></tr>
<tr><td colspan=63 height=9></td></tr>
<tr valign=top>
<td height=9></td>
<td width=210 colspan=21 rowspan=2><font face="helvetica" color="#007f7f"><b>FLORIDA LOTTERY</b></font></td>
<td colspan=11></td>
<td width=301 colspan=27 rowspan=2 align=right><font face="helvetica" color="#007f7f"><b>Winning Numbers History</b></font></td>
<td colspan=3></td>
</tr>
<tr valign=top>
<td height=9></td>
<td colspan=11></td>
<td colspan=3></td>
</tr>
<tr><td colspan=63 height=9></td></tr>
<tr valign=top>
<td height=9></td>
<td width=174 colspan=14 rowspan=2><font face="helvetica" color="#007f7f"><b>13-JAN-2013</b></font></td>
<td colspan=29></td>
<td width=187 colspan=16 rowspan=2 align=right> <font face="helvetica" color="#007f7f"><b>Page </b></font><font face="helvetica" color="#007f7f"><b>1</b></font><font face="helvetica" color="#007f7f"><b> of </b></font><font face="helvetica" color="#007f7f"><b>20</b></font><br></td>
<td colspan=3></td>
</tr>
<tr valign=top>
<td height=9></td>
<td colspan=29></td>
<td colspan=3></td>
</tr>
<tr valign=top>
<td height=9 colspan=3></td>
<td width=730 colspan=59 rowspan=3> <font size=2 face="helvetica">Please note every effort has been made to ensure that the enclosed information is accurate; however, in the event of an error, the winning  numbers in the official record of the Florida Lottery shall be controlling.</font><br></td>
<td></td>
</tr>
<tr valign=top>
<td height=9 colspan=3></td>
<td></td>
</tr>
<tr valign=top>
<td height=9 colspan=3></td>
<td></td>
</tr>
<tr><td colspan=63 height=9></td></tr>
<tr valign=top>
<td height=9 colspan=2></td>
<td width=733 colspan=59 rowspan=2 align=center><font face="helvetica"><b>FLORIDA LOTTO</b></font></td>
<td colspan=2></td>
</tr>
<tr valign=top>
<td height=9 colspan=2></td>
<td colspan=2></td>
</tr>
<tr valign=top>
<td height=9 colspan=2></td>
<td colspan=59><hr size=1 noshade></td>
<td colspan=2></td>
</tr>
<tr valign=top>
<td height=9 colspan=4></td>
<td width=46><font size=2 face="helvetica">01/12/13</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">2</font></td>
<td></td>
<td width=9 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=12 align=right><font size=2 face="helvetica">9</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 colspan=2 align=right><font size=2 face="helvetica">12</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">24</font></td>
<td></td>
<td width=10 colspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">31</font></td>
<td></td>
<td width=11 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 align=right><font size=2 face="helvetica">46</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">X4</font></td>
<td></td>
<td width=46 colspan=2><font size=2 face="helvetica">07/21/12</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">10</font></td>
<td></td>
<td width=9 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">14</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=15 colspan=2 align=right><font size=2 face="helvetica">15</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">31</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">34</font></td>
<td></td>
<td width=11 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 align=right><font size=2 face="helvetica">50</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">X5</font></td>
<td colspan=4></td>
</tr>
<tr valign=top>
<td height=9 colspan=4></td>
<td width=46 rowspan=2><font size=2 face="helvetica">01/09/13</font></td>
<td></td>
<td width=13 rowspan=2 align=right><font size=2 face="helvetica">19</font></td>
<td></td>
<td width=9 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=12 rowspan=2 align=right><font size=2 face="helvetica">20</font></td>
<td></td>
<td width=10 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 colspan=2 rowspan=2 align=right><font size=2 face="helvetica">24</font></td>
<td></td>
<td width=10 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 rowspan=2 align=right><font size=2 face="helvetica">27</font></td>
<td></td>
<td width=10 colspan=2 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 rowspan=2 align=right><font size=2 face="helvetica">42</font></td>
<td></td>
<td width=11 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 rowspan=2 align=right><font size=2 face="helvetica">51</font></td>
<td></td>
<td width=14 rowspan=2 align=right><font size=2 face="helvetica">X4</font></td>
<td></td>
<td width=46 colspan=2 rowspan=2><font size=2 face="helvetica">07/18/12</font></td>
<td></td>
<td width=13 rowspan=2 align=right><font size=2 face="helvetica">1</font></td>
<td></td>
<td width=9 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 rowspan=2 align=right><font size=2 face="helvetica">3</font></td>
<td></td>
<td width=10 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=15 colspan=2 rowspan=2 align=right><font size=2 face="helvetica">7</font></td>
<td></td>
<td width=10 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 rowspan=2 align=right><font size=2 face="helvetica">23</font></td>
<td></td>
<td width=10 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 rowspan=2 align=right><font size=2 face="helvetica">33</font></td>
<td></td>
<td width=11 rowspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 rowspan=2 align=right><font size=2 face="helvetica">44</font></td>
<td></td>
<td width=14 rowspan=2 align=right><font size=2 face="helvetica">X5</font></td>
<td colspan=4></td>
</tr>
<tr valign=top>
<td height=9 colspan=4></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan=4></td>
</tr>
<tr valign=top>
<td height=9 colspan=4></td>
<td width=46><font size=2 face="helvetica">01/05/13</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">8</font></td>
<td></td>
<td width=9 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=12 align=right><font size=2 face="helvetica">19</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 colspan=2 align=right><font size=2 face="helvetica">21</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">23</font></td>
<td></td>
<td width=10 colspan=2 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">36</font></td>
<td></td>
<td width=11 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 align=right><font size=2 face="helvetica">40</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">X4</font></td>
<td></td>
<td width=46 colspan=2><font size=2 face="helvetica">07/14/12</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">8</font></td>
<td></td>
<td width=9 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">19</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=15 colspan=2 align=right><font size=2 face="helvetica">31</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">37</font></td>
<td></td>
<td width=10 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=13 align=right><font size=2 face="helvetica">41</font></td>
<td></td>
<td width=11 align=right><font size=2 face="helvetica">-</font></td>
<td></td>
<td width=16 align=right><font size=2 face="helvetica">51</font></td>
<td></td>
<td width=14 align=right><font size=2 face="helvetica">X5</font></td>
<td colspan=4></td>

I have tried a few things....but the only thing that worked was the code you supplied me with ...as I said earlier this works.....I modified the code abit...which now gets the correct date...now I need to work on getting the numbers....

  'define the regular expressions to match date and numbers
        HTMLString = RichTextBox1.Text
        Dim myDateMatcher As New Regex("[0-9][0-9]/[0-9][0-9]/[0-9][0-9]")
        Dim myNumberMatcher As New Regex(">[0-9][0-9]<")
        'get the date match and save it
        Dim myDateMatches As MatchCollection = myDateMatcher.Matches(HTMLString)
        For Each DateMatch As Match In myDateMatches
            RichTextBox1.Text = DateMatch.Value & vbCrLf
            If RichTextBox1.Text <> "" Then
                MostRecentDate = DateMatch.ToString
                MsgBox(MostRecentDate)
                Exit For
            End If
        Next
        'split the date match and then use the sceond element of the array to match the numbers
        Dim myDateSplit() As String = myDateMatcher.Split(HTMLString)
        Dim myNumberMatches As MatchCollection = myNumberMatcher.Matches(myDateSplit(1))
        'get the number matchs and save them
        For Each MatchedNumber As Match In myNumberMatches
            RichTextBox1.Text += MatchedNumber.Value.Substring(1, 2) & vbCrLf
        Next


this code gets 4 of the six numbers needed...not sure why.

Thanks for your help

InkedGFX
 
Last edited:
Back
Top