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

Field Splitting

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

    Field Splitting

    I have an interesting split to do.
    I have a full name using spaces.
    It can consist of a prefix first name middle initial last name with or without a prefix like Mc or Mac and a suffix.
    prefixes - "TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF"
    suffixes - "SR PE P.E. MD JR PHD III II L G CEM" or "PH D P E"
    middle intial - "I." or "I"

    The field split genie does not do suffixes and title does not suffice for my prefixes.
    Jim

    #2
    Re: Field Splitting

    More information.
    I thought I would try this for prefix:
    ut(if (textsearch("TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF", UT(word(Fullname, 1)) <> 0), word(Fullname), 1)+".", ""))

    Comment


      #3
      Re: Field Splitting

      If possible I'd approach this from the other direction. Have fields for TITLE, FIRSTNAME, INITIAL, SURNAME and SUFFIX, then concatenate them to create the fullname.

      If it's too late to go in that direction I'm someone else on here will think of a wizard way to help.

      ps. Not sure about the US, but in the UK Mc, Mac etc. are not prefixes, they're just part of the surname. There are other instances where a surname contains a space such as de Souza
      Last edited by armasoft; 02-18-2018, 06:01 AM. Reason: add ps.

      Comment


        #4
        Re: Field Splitting

        My issue is I have the full name and I need to split it into: title (which can contain military prefixes etc.), first name, initial, surname (sometimes the surname is more than 1 word) and suffix. We receive data in both formats to add to our databases. So I need to be able to pull the name apart. I already know how to combine them. And here MC, Mac And De are sometimes combined with the rest of the surname or they are 2 words.
        Jim

        Comment


          #5
          Re: Field Splitting

          My issue is I have the full name and I need to split it into: title (which can contain military prefixes etc.), first name, initial, surname (sometimes the surname is more than 1 word) and suffix. We receive data in both formats to add to our databases. So I need to be able to pull the name apart. I already know how to combine them. And here MC, Mac And De are sometimes combined with the rest of the surname or they are 2 words. Mc Master Or McMaster as examples.
          Jim

          Comment


            #6
            Re: Field Splitting

            Usually We split Prefix(Title), First Name(First Name And Middle Initial), Last Name(Surname) and Suffix.
            Jim

            Comment


              #7
              Re: Field Splitting

              add new fields to the table.

              Use the update genie to guide you to an update operation to start with.

              modify that operation to fit your situation.updateGenie.jpg
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: Field Splitting

                I would create a couple of static tables, one that contains records for each of the different prefixes/ titles and another for each of the different suffixes.
                Next I would add a field to the fullname table and give each record a unique id using an update operation. If you are importing this table, you can make the field auto increment so the import operation will automatically add the next number for you. Then I would add a calculated field to the fullname table that takes every word in the fullname field and inserts a character like '^' between the words (do the update on the table first then change the field rule to calculated and your import will make the change. Now you have a string that you can parse in a script by making several loops through the fullname table. Matching first the prefix & suffix to an array from the static tables and mapping those values if found into the proper fields - then I would remove that data from the string so you can work with just the name portion of the string, and get a new word count.

                Stan is really good with stuff like this, and he probably could do something simpler.
                Last edited by MoGrace; 02-20-2018, 03:18 PM.
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                  #9
                  Re: Field Splitting

                  To Al, The genie forgot suffix.

                  As for prefix - I have 'Prefix = if(textsearch("TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF", ut(word(Fullname), 1)), ut(word(Fullname), 1)), "")'

                  Now Firstname - 'IF(UT(WORD(FULLNAME, 1))<>"MR" .AND. UT(WORD(FULLNAME, 1))<>"MRS" .AND. UT(WORD(FULLNAME, 1))<>"MS" .AND. UT(WORD(FULLNAME, 1))<>"MISS" .AND. UT(WORD(FULLNAME, 1))<>"DR" .AND. UT(WORD(FULLNAME, 1))<>"HON" .AND. UT(WORD(FULLNAME, 1))<>"LT" .AND. UT(WORD(FULLNAME, 1))<>"PROF" .AND. UT(WORD(FULLNAME, 1))<>"REV" .AND. UT(WORD(FULLNAME, 1))<>"SGT" .AND. UT(WORD(FULLNAME, 1))<>"SSGT" .AND. UT(WORD(FULLNAME, 1))<>"TSGT" .AND. W_COUNT(FULLNAME)>1 .AND. ATC(",", FULLNAME)=0, WORD(FULLNAME, 1), IF(W_COUNT(FULLNAME)<3 .OR. ((UT(WORD(FULLNAME, 1))="MR" .OR. UT(WORD(FULLNAME, 1))="MRS" .OR. UT(WORD(FULLNAME, 1))="MS" .OR. UT(WORD(FULLNAME, 1))="MISS" .OR. UT(WORD(FULLNAME, 1))="DR" .OR. UT(WORD(FULLNAME, 1))="HON" .OR. UT(WORD(FULLNAME, 1))="LT" .OR. UT(WORD(FULLNAME, 1))="PROF" .OR. UT(WORD(FULLNAME, 1))="REV" .OR. UT(WORD(FULLNAME, 1))="SGT" .OR. UT(WORD(FULLNAME, 1))="SSGT" .OR. UT(WORD(FULLNAME, 1))="TSGT") .AND. ATC(",", FULLNAME)>0 .AND. W_COUNT(FULLNAME)=3), "", WORD(FULLNAME, 2)))'

                  With middle intitial going into the firstname - 'iif(w_count(FULLNAME) < 3, "", iif(len(word(FULLNAME, 2)) = 1 .or. (len(word(FULLNAME, 2)) = 2 .and. right(word(FULLNAME, 2), 1) = "."), word(FULLNAME, 2), iif(len(word(FULLNAME, 3)) = 1 .or. (len(word(FULLNAME, 3)) = 2 .and. right(word(FULLNAME, 3), 1) = "."), word(FULLNAME, 3), iif(len(word(FULLNAME, 4)) = 1 .or. (len(word(FULLNAME, 4)) = 2 .and. right(word(FULLNAME, 4), 1) = "."), word(FULLNAME, 4), ""))))'


                  And for suffix - 'if(textsearch("PH D P E", ut(word(Fullname, -2, " ", 2))), ut(word(Fullname, -2, " ", 2)), if(textsearch("SR PE P.E. MD JR PHD III II L G CEM", ut(word(Fullname, -1))), ut(word(Fullname, -1)), ""))'

                  I am Just missing how to process the last name.
                  Jim

                  Comment


                    #10
                    Re: Field Splitting

                    I apologize my Firstname is 'if( (textsearch("TSGT SSGT SGT REV MDM MS MR MRS MISS HON SEN DR LT PROF", ut(word(Fullname), 1)) = 0) .AND. W_COUNT(FULLNAME) > 1 .AND. ATC(",", FULLNAME) = 0, WORD(FULLNAME, 1), IF(W_COUNT(FULLNAME) < 3 .OR. if((textsearch("TSGT SSGT SGT REV MDM MS MR MRS MISS HON SEN DR LT PROF", ut(word(Fullname), 1)) <> 0) .AND. ATC(",", FULLNAME)>0 .AND. W_COUNT(FULLNAME)=3), "", WORD(FULLNAME, 2)))'

                    Jim

                    Comment


                      #11
                      Re: Field Splitting

                      Also how to process firstname to remove suffix.
                      Jim

                      Comment


                        #12
                        Re: Field Splitting

                        You can eliminate a lot of .and. and .or. if you use inlist2() or is_one_of().

                        Code:
                        fullname = "SGT Thomas A Barton, Jr"
                        
                        ? is_one_of(UT(WORD(FULLNAME, 1)),comma_to_crlf(("TSGT,SSGT,SGT,REV,MS,MR,MRS,MISS,HON,SEN,DR,LT,PROF")))
                        = .T.
                        
                        ? inlist2(UT(WORD(FULLNAME, 1)),"TSGT,SSGT,SGT,REV,MS,MR,MRS,MISS,HON,SEN,DR,LT,PROF")
                        =.T.
                        
                        'to test the negative
                        
                        ? (.not. is_one_of(UT(WORD(FULLNAME, 1)),comma_to_crlf(("TSGT,SSGT,SGT,REV,MS,MR,MRS,MISS,HON,SEN,DR,LT,PROF"))))
                        = .F.
                        ? (.not. inlist2(UT(WORD(FULLNAME, 1)),"TSGT,SSGT,SGT,REV,MS,MR,MRS,MISS,HON,SEN,DR,LT,PROF"))
                        = .F.
                        There can be only one.

                        Comment


                          #13
                          Re: Field Splitting

                          Stan, I will give your title / prefix code a shot. I will also use the code for suffix. I still am not sure how suffix will affect the breaking apart the first and last names.

                          I did a modified version of my code with the genie name splitting code and still ended up with first and last name in lastname.

                          My Code:
                          Prefix - iif(textsearch("TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF", ut(word(fullname, 1))), ut(word(Fullname, 1)), "")

                          Suffix - iif(textsearch("PH D P E", ut(word(Fullname, -2, " ", 2))), ut(word(Fullname, -2, " ", 2)), iif(textsearch("SR PE P.E. MD JR PHD III II L G CEM", ut(word(Fullname, -1))), ut(word(Fullname, -1)), ""))

                          Firstname - iif( textsearch("TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF", ut(word(Fullname, 1))) .AND. W_COUNT(Fullname) > 1 .AND. ATC(",", Fullname) = 0, WORD(Fullname, 1), iif( ( (w_count(Fullname) < 3 .or. textsearch("TSGT SSGT SGT REV MS MR MRS MISS HON SEN DR LT PROF", ut(word(Fullname, 1))) = .f. ) .and. ATC(",", Fullname)>0 .and. w_count(Fullname) = 3), "", word(Fullname, 2)) )

                          Firstname - iif(w_count(Fullame) < 3, "", iif(len(word(Fullname, 2)) = 1 .or. (len(word(Fullname, 2)) = 2 .and. right(word(Fullname, 2), 1) = "."), word(Fullname, 2), iif(len(word(Fullname, 3)) = 1 .or. (len(word(Fullname, 3)) = 2 .and. right(word(Fullname, 3), 1) = "."), word(Fullname, 3), iif(len(word(Fullname, 4)) = 1 .or. (len(word(Fullname, 4)) = 2 .and. right(word(Fullname, 4), 1) = "."), word(Fullname, 4), ""))))

                          Lastname - ut(word(Fullname, (w_count(Prefix) + w_Count(Firstname) + 1), " ", (w_count(Fullname) - w_count(Prefix) - w_count(Firstname) - w_count(Suffix) ) ) )

                          Jim
                          Last edited by NerdJim; 02-21-2018, 03:30 PM. Reason: Formatting

                          Comment


                            #14
                            Re: Field Splitting

                            Fullname____________Prefix Firstname Lastname Suffix
                            A Potter__________________________ Potter
                            A Thomas________________________ Thomas
                            Aaron Ballard______________________Ballard
                            Aaron Chesir______________________ Chesir

                            My results
                            Last edited by NerdJim; 02-21-2018, 03:29 PM. Reason: Formatting

                            Comment


                              #15
                              Re: Field Splitting

                              Fullname____________Prefix Firstname Lastname Suffix
                              A Potter__________________________Potter
                              A Thomas________________________ Thomas
                              Aaron Ballard_____________________ Ballard
                              Aaron Chesir______________________Chesir

                              My results

                              Comment

                              Working...
                              X