Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Parsing Data using EXTRACT_STRING() question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Parsing Data using EXTRACT_STRING() question

    I'm trying to parse out data from a DMV web page by copying the text and placing it into a memo field, then using the EXACT_STRING() function to separate out the necessary fields.

    Fortunately most of the needed fields are preceeded by the field name such as "Vehicle Make:" which allows me to use that as the "starting point," (a delimiter of sorts), and then I use the field name of the next field as my "end point."

    This works fine for almost every field except three, and I'm looking for some suggestions on those, but I'll just ask about the first one here now to avoid confusion.

    One of the fields is the vehicle owner's address, and it appears as:

    Owner Information
    License Number:L-200-488-762-000 Suspended/Revoked:YES
    Name:JOHN WILLIAM DOE
    Address: 1234 WILLIAMSBURG ST
    FT WASHINGTON PG MD 20744
    Height:5-08 Weight:115 Race:1 Sex:M Date of Birth:09/29/76
    As you can see the address is on two lines, with nothing but a carriage return to separate them. I am using the expression of EXTRACT_STRING(MEMO,"Address: ",CRLF()) which gets me 1234 WILLIAMSBURG ST exactly as I want, but I can't figure out how to grab the next line after the carriage return? (City, State, County, Zip) In other words, I want to capture the string after the carriage return, but end at the beginning of the next field name of "Height:"
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    #2
    Re: Parsing Data using EXTRACT_STRING() question

    Is the line after the address always Height? I would extract the address in total with
    EXTRACT_STRING(MEMO,"Address: ","H")
    then then street address is
    word(EXTRACT_STRING(MEMO,"Address: ","H") ,1,crlf())
    then the rest is
    word(EXTRACT_STRING(MEMO,"Address: ","H") ,2,crlf())

    I think that's right. I can't get to the documentation wiki to double check.
    There can be only one.

    Comment


      #3
      Re: Parsing Data using EXTRACT_STRING() question

      word(EXTRACT_STRING(MEMO,"Address: ","Height:") ,2,crlf()) should do it.

      oops, didn't see that Stan replied while I was.

      Stan, yep that's right but I would use the the complete tag as the delimiter as in 'Height:'. Just using "H" runs the risk of it being in the address. In this case the return would be "FT WAS"
      Last edited by Tim Kiebert; 01-01-2013, 05:31 PM.
      Tim Kiebert
      Eagle Creek Citrus
      A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

      Comment


        #4
        Re: Parsing Data using EXTRACT_STRING() question

        Just using "H" runs the risk of it being in the address
        Correct, thanks.
        There can be only one.

        Comment


          #5
          Re: Parsing Data using EXTRACT_STRING() question

          Excellent! Yes Stan, the next field name is always "Height:", so as Tim said, using it in full prevents complications from just using the letter "H., and the expression of word(EXTRACT_STRING(MEMO,"Address: ","Height:") ,2,crlf()) works like a champ!!

          Now to the second issue:

          The parsed field from the above expression, results in this data:
          FT WASHINGTON PG MD 20744
          Which is the City (Ft Washington), the County (PG), the State (MD), and the Zip (20744).

          The unusual field of "County" always shows on Maryland Licenses and Registrations (and that is all I'm working with here) so it will always be present. I'm using the "Break City/State/Zip into its parts" expression to break up this field, but with the added County field, I'm getting only the City and the Zip parsed correctly, with the County showing up in the State field, and nothing showing up in the County field.

          Is there a way to get all four parts of this line to break apart correctly?
          Sergeant Richard Hartnett
          Hyattsville City Police Department
          Maryland

          Comment


            #6
            Re: Parsing Data using EXTRACT_STRING() question

            You're going to have a heck of a time designing that expression.

            Suppose the second line was

            Sault Ste. Marie MR MI 49783
            There can be only one.

            Comment


              #7
              Re: Parsing Data using EXTRACT_STRING() question

              I was afraid you were going to say that.

              These are the "knowns:"
              The Zip will always be 5 characters. (They don't use the full zip code on these reports)
              The State will always be 2 characters.
              The County will always be 1-3 characters.

              Any way I could work with that starting from the far right?
              Sergeant Richard Hartnett
              Hyattsville City Police Department
              Maryland

              Comment


                #8
                Re: Parsing Data using EXTRACT_STRING() question

                If it makes any difference, I do not need the "County" field for anything, just the City, State and Zip Code.
                Sergeant Richard Hartnett
                Hyattsville City Police Department
                Maryland

                Comment


                  #9
                  Re: Parsing Data using EXTRACT_STRING() question

                  Taking the knowns you can split the word(EXTRACT_STRING(MEMO,"Address: ","Height:") ,2,crlf())

                  Where are you doing this? Do we need calculated fields for each of the pieces or a script to process the total address value into fields?
                  There can be only one.

                  Comment


                    #10
                    Re: Parsing Data using EXTRACT_STRING() question

                    Thanks for the help Stan. I have a simple table that starts with the memo field, then parses out the individual fields. As for the address, I have one that is called "CityStateFull," which contains, the CITY, COUNTY, STATE & ZIP from the expression you provided above. Then I have four individual fields which would contain the actual city, county, state, and zip once they have been broken up from the City_State field. (See attached pics)

                    (I don't need the county field if it makes any difference.)
                    Attached Files
                    Sergeant Richard Hartnett
                    Hyattsville City Police Department
                    Maryland

                    Comment


                      #11
                      Re: Parsing Data using EXTRACT_STRING() question

                      So we need calculated field expressions to trigger off the data entry into the full address field. I'll work on it in the morning if no one else gets there first.
                      There can be only one.

                      Comment


                        #12
                        Re: Parsing Data using EXTRACT_STRING() question

                        Something tells me there is a better way to deal with your second problem, but if nothing better shows up here you might be able use the WORD() (using a negative parameter) and W_COUNT() functions to build an expression. It's too late here for me to try for something better--need to get some sleep.

                        ?word("Sault Ste. Marie MR MI 49783",-1)
                        = "49783" (zip)
                        ?word("Sault Ste. Marie MR MI 49783",-2)
                        = "MI" (state)
                        ?word("Sault Ste. Marie MR MI 49783",-3)
                        = "MR" (county whether 2 or 3 characters)
                        ?w_count("Sault Ste. Marie MR MI 49783")
                        = 6 (total # of words)
                        'So words 1, 2 and 3 have to be the city

                        ?word("FT WASHINGTON PG MD 20744",-1)
                        = "20744"
                        ?word("FT WASHINGTON PG MD 20744",-2)
                        = "MD"
                        ?word("FT WASHINGTON PG MD 20744",-3)
                        = "PG"

                        Raymond Lyons

                        Comment


                          #13
                          Re: Parsing Data using EXTRACT_STRING() question

                          Fantastic!! Ray that works like a champ!

                          Now will it make any difference if the County has more or less characters? (The county is normally listed as 1,2, or 3 characters)
                          Sergeant Richard Hartnett
                          Hyattsville City Police Department
                          Maryland

                          Comment


                            #14
                            Re: Parsing Data using EXTRACT_STRING() question

                            I think the issue with the county will be how many words the city has, but I agree working backwards is a good way to go.

                            one way might be to verify the number of words in the city name from a zip code fetch.find
                            Cole Custom Programming - Terrell, Texas
                            972 524 8714
                            [email protected]

                            ____________________
                            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                            Comment


                              #15
                              Re: Parsing Data using EXTRACT_STRING() question

                              I have to add this so it is at least in here. I work backwards often The knowns related to this data string are at the end. The end can be the beginning, so to speak. I use this strategy often.
                              Code:
                              dim vCSZ as C="Sault Ste. Marie MR MI 49783"
                              
                              dim vzip as C
                              vzip=*reverse(left(*reverse(vCSZ),5))
                              ? vzip
                              = "49783"
                              
                              dim vst as C
                              vst=alltrim(*reverse(substr(*reverse(vCSZ),6,4)))
                              ? vst
                              = "MI"
                              
                              dim vcity as C
                              vcity=*reverse(word(*reverse(word_subtract(vCSZ,vzip+" "+vst)),3," ",5))
                              ? vcity
                              = "Sault Ste. Marie"
                              Last edited by Mike Wilson; 01-02-2013, 10:49 AM.
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X