Welcome Guest
Log In | Register )
You last visited January 24, 2017, 2:09 pm
All times shown are
Eastern Time (GMT-5:00)

Parsing

Topic closed. 91 replies. Last post 12 years ago by Sedertree.

Page 3 of 7
PrintE-mailLink
Avatar
East Jordan, MI
United States
Member #2
June 1, 2001
675 Posts
Offline
Posted: January 20, 2005, 4:50 am - IP Logged

Got the bugs/logic errors worked out for the side-by-side drawfile comparison function tonight. Decided to add a statusbar to the bottom of the listboxes that will show how many entries there are in each drawfile that you are comparing/contemplating for integration. That should help to track down where the missing entries are in each, I'll do the code for those totals in the morning.



I'm not really teasing



I want to keep a running log of the progress as it happens. I'm not a platinum member yet so I don't want to put this in my Blog and have it disappear after awhile. Besides, maybe some of these functions I post can help another lottery programmer.



I should have the drawfile editor completed to my satisfaction by the end of this weekend if all goes well.



The next phase of programming will be to make sure that all the functions on the mainform are working properly. I had fixed the Spike/Trough Filters before, but had not burned a copy of the sourcecode before my last system crash. Soooooo I will have to fix them again and burn it this time. BTW I burned a copy tonight of my recent work. I'll try to do this every few days.



As for Beta-Testers, I have one fellow who does this for me. I would like to have one or two more who have have already worked with SMWS before and are comfortable with the concept. It probably will take the better part of this year before I have it ready for Beta-Testing.

    Avatar
    East Jordan, MI
    United States
    Member #2
    June 1, 2001
    675 Posts
    Offline
    Posted: January 22, 2005, 1:10 am - IP Logged

    Back at it again this weekend....



    Had an idea for a "Drawfile Converter" to add to my Drawfile Editor arsenal. Here is the format SMWS uses.



    01/21/2005 211

    01/20/2005 424

    01/19/2005 925

    01/18/2005 225



    Lotterypost Uses;



    Fri, Jan 21, 2005     2-1-1

    Thu, Jan 20, 2005     4-2-4

    Wed, Jan 19, 2005     9-2-5

    Tue, Jan 18, 2005     2-2-5



    How many different formats can we come up with to convert to SMWS format.

      Todd's avatar - Cylon 2.gif
      Chief Bottle Washer
      New Jersey
      United States
      Member #1
      May 31, 2000
      23356 Posts
      Online
      Posted: January 22, 2005, 1:13 am - IP Logged

      George:

      Just use Excel.  It is AWESOME at quickly converting large amounts of data, and is equally awesome in its copy & paste abilities.  Those dates would convert in a snap.

       

      Check the State Lottery Report Card
      What grade did your lottery earn?

       

      Sign the Petition for True Lottery Drawings
      Help eliminate computerized drawings!

        Avatar
        East Jordan, MI
        United States
        Member #2
        June 1, 2001
        675 Posts
        Offline
        Posted: January 22, 2005, 1:43 am - IP Logged

        Todd,



        I'm ashamed to admit it, but I'm really not that versed in Excel. I read somewhere that you can use spreadsheets? in VB. I really haven't done a lot of research into that yet.



        My goal with the converter is to allow the user to use "any" source for their drawfile data. There has to be a permutation limit on how many ways the source can display that information.



        Like Michigan for example has gif's along with the data. But if you copy and paste - including gif's - to notepad it comes out like this.



              Tue. Jan 18, 2005       225

             Wed. Jan 19, 2005      925

             Thu. Jan 20, 2005      424

             Fri. Jan 21, 2005      211



        I'd like to develop an algorithm/parser that can deal with any format and convert it to a form that SMWS can recognize. The trick is to find out what format the .txt file is in and then sub to the correct parser and convert it.



        I know some states (MI incl.) append their drawfile data to the bottom of the list. Which means that I'll have to sort the list by date. It will be a challenge I'm sure.



        As for me, I download drawfiles for LottoBuster and open them in VB. Then I have to copy the data to Ultraedit32 and delete the columns I don't need. A whole lot of extra steps that I think needs simplifying.



        BTW, LottoBuster uses;



        [09/04/2004 Evening    04 07 06]

        [09/03/2004 Evening    05 05 09]

        [09/02/2004 Evening    00 00 04]

        [09/01/2004 Evening    03 03 08]

          Todd's avatar - Cylon 2.gif
          Chief Bottle Washer
          New Jersey
          United States
          Member #1
          May 31, 2000
          23356 Posts
          Online
          Posted: January 22, 2005, 7:47 am - IP Logged

          George,

          Creating a good parser is a huge challenge and can really suck the life out of you.  If you're up for a good challenge, then go for it.

          By the way, if you're not versed in regular expressions, this may be a good opportunity to learn.  They are monumentally powerful, but syntactically difficult to learn.  The good thing about regex's is that there is a way to parse just about anything using them, but you'll find that creating the regex string is an art form.

          You may want to search the net for pre-written VB functions for parsing dates -- something that will look for just about any date format.  Parsing the numbers should be relatively easy.

          Good luck!

           

          Check the State Lottery Report Card
          What grade did your lottery earn?

           

          Sign the Petition for True Lottery Drawings
          Help eliminate computerized drawings!

            Berley's avatar - animal bear.jpg
            ROGERS, AR.
            United States
            Member #931
            December 18, 2002
            118 Posts
            Offline
            Posted: January 22, 2005, 8:43 pm - IP Logged

            Sedertree check the draw files in versebet they can be saved as excell or text files.

            hope this helps.

            GOOD LUCK.

            __________
            Berley

              retxx's avatar - mrthumbs
              BOSTON
              United States
              Member #48
              September 9, 2001
              3614 Posts
              Offline
              Posted: January 23, 2005, 8:06 pm - IP Logged

              george question; I got a pop up saying runtime error 380 invalid property value. i went to the website to the ocx's and looked at the entire list to download and could not find what to download. Can you help by pointing it out

                Avatar
                East Jordan, MI
                United States
                Member #2
                June 1, 2001
                675 Posts
                Offline
                Posted: January 23, 2005, 11:01 pm - IP Logged

                Retxx,



                The error "invalid property value" is not OCX related. It would help to know what you are doing when this error comes up. It could be one of many things - all user defined "logic errors".



                The first thought is that you are using a setting that doesn't exist or is out of range. Since, I believe, all the settings have limits to what values the user can assign. You might have an invalid setting in a .sed file. Like trying to assign a sum total setting higher than 27 for the pick-3. Or using a string (twenty-seven) where an integer (27) should go.



                I'm not there at your computer so I can't do your thinking for you. You'll have to isolate the cause and let me know what you're doing wrong.



                  retxx's avatar - mrthumbs
                  BOSTON
                  United States
                  Member #48
                  September 9, 2001
                  3614 Posts
                  Offline
                  Posted: January 23, 2005, 11:22 pm - IP Logged

                  as far as I know it happens when i hit the reset button and I try and load another file such as one I built from notepad. Does this make any sense? as far as the profile I keep all in range as far as I can see. thanks

                    Avatar
                    East Jordan, MI
                    United States
                    Member #2
                    June 1, 2001
                    675 Posts
                    Offline
                    Posted: January 24, 2005, 4:46 am - IP Logged

                    Retxx,



                    "load another file".....



                    Do you mean a .sed profile or a drawfile.

                      Avatar
                      East Jordan, MI
                      United States
                      Member #2
                      June 1, 2001
                      675 Posts
                      Offline
                      Posted: January 24, 2005, 5:01 am - IP Logged

                      Worked most of the night and succeeded in determining that drawfiles were either in Lottobusters' Pick-3 or Pick-4 formats. Haven't started the actual conversions yet to SMWS. I have a handful of formats that I'll need to analyze and find out "what they are" before I start doing conversions.



                      Some formats can be converted and some cannot. What's exciting is that some official lottery websites archives can be converted as well. Here is a list of those I can convert;



                      VersaBet:

                      LottoBuster:

                      LotteryPost:

                      Michigan Lottery:

                      Arizona Lottery:

                      California Lottery:

                      Florida Lottery:

                      Idaho Lottery:

                      Minnesota Lottery:

                      New Jersey Lottery: (Combined Only)

                      New York Lottery:

                      Texas Lottery:

                      Tri-State Lottery:



                      That's all for tonight.....

                        retxx's avatar - mrthumbs
                        BOSTON
                        United States
                        Member #48
                        September 9, 2001
                        3614 Posts
                        Offline
                        Posted: January 24, 2005, 10:22 am - IP Logged

                        I think when I take notepad and save as and add it to sedertree it is a text file,right?

                          Avatar
                          East Jordan, MI
                          United States
                          Member #2
                          June 1, 2001
                          675 Posts
                          Offline
                          Posted: January 24, 2005, 10:30 am - IP Logged

                          Yes, notepad saves as a .txt file. Also check that your format is correct.



                          00/00/0000<sp>000

                            Avatar
                            East Jordan, MI
                            United States
                            Member #2
                            June 1, 2001
                            675 Posts
                            Offline
                            Posted: January 25, 2005, 2:26 pm - IP Logged

                            Getting ready for work....



                            So far I have the drawfile converter recognizing;



                            VersaBet, LottoBuster, LotteryPost and Michigan Lottery Formats. Tonight after work I'll work on some more of the formats listed in my previous post.



                            It will be nice to get all these formats recognized so I can work on the actual conversions.



                            This will be nice for non-standard members of lotterypost to convert Todd's drawfile format into a format that SMWS will recognize.



                            Are there any other lottery software drawfiles that someone would like to convert? If so, copy and paste about seven draws for the Pick-3 and Pick-4 as long as they are in .txt format source. Let me know what software or source they come from and I'll see if I can convert them as well.



                            Depending on interest, I could also convert drawfiles from one format to another. VersaBet and LottoBuster are moot since users can download their drawfiles. Maybe you might want to convert Lotterypost Format to another software's format. Or SMWS to another software's format.



                            Thanks,

                              Developer's avatar - logo2 small.jpg
                              Somerset
                              United Kingdom
                              Member #9710
                              December 17, 2004
                              186 Posts
                              Offline
                              Posted: January 25, 2005, 2:48 pm - IP Logged

                              On the conversion side of things it gets tricky, I know been there done that as they say.

                              Points to think about and look out for

                              Dates (The real hurdle in your quest)

                              dd/mm/yyyy, or dd/mm/yy or mm/dd/yyyy or dd/mm/yyyy

                              This can be a real headache.

                              Parsing strings

                              tip use IsNumeric() , IsNull(), IsDate()

                              Also use the split function

                              I wrote a little function to split space and comma strings for you

                              Function SplitString(WhatString As String)
                              Dim SplitStr() As String
                              Dim SplitCount As Double
                              Dim I As Double
                                  SplitCount = 0
                                 
                              If SplitCount <= 0 Then SplitStr = Split(WhatString, " ", 20, vbTextCompare): SplitCount = UBound(SplitStr)
                              If SplitCount <= 0 Then SplitStr = Split(WhatString, ",", 20, vbTextCompare): SplitCount = UBound(SplitStr)


                                  For I = 0 To SplitCount ' Loop through each split
                                      If IsDate(SplitStr(I)) Then MsgBox "The date is " & SplitStr(I)
                                      If IsNumeric(SplitStr(I)) Then MsgBox "The number is " & Val(SplitStr(I))
                                  Next I
                                 
                              End Function