5 Replies Latest reply on Nov 12, 2013 5:46 AM by bawilliamson

    Parsing Section-Township-Range — Part 2

    bawilliamson

      I have now successfully parsed the Section Number, Township Number, Township Direction, Range Number & Range Direction into five separate fields. Thanks for the help! Now I am trying to finish the job.

       

      In front of each Section, Township & Range listing in each record there are other "words" such as:

      NW/2

      SE/4 & SE/4 NE/4

      SW/4 NW/4 & NW/4 SW/4

      E/2 E/2 NE/4

      W/2NE/4 & W/2E/2NE/4

       

      I could just highlight this data in each record and use a script that copies what I've highlighted and automatically pastes that data into another field. This shouldn't take more than an hour or so.

       

      But I am wondering if there is another, less time-consuming way to look at this task. I've tried LeftWords and RightWords to no avail. I think the sticking point is the wide variety and number of "words" that I'm dealing with. Basically I just want to return a text result that ignores the one consistent Section-Township-Range "word" that is present on the right side of each entry (e.g., 5-15N-18E) in each record and returns everything else to the left of that "word" in that field, no matter how that other data is formatted or how many words it contains.

       

      This is a one-time task for the 750 records, since new legal information will be input in a different way. But I am always wanting to learn new ways of thinking about these kinds of problems in Filemaker.

       

      Thanks!

        • 1. Re: Parsing Section-Township-Range — Part 2
          beverly

          I've often used PatternCount to test for a particular "delimiter". If you are getting "-" sometimes and "/" sometimes and " " (space) sometimes, you can test the field for these and change your calc to substitute the delimiter for whatever makes consistency. You can sometimes only get it calc'd but still need a human to fix these inconsistent records after all others are calc'd.

           

          Beverly

          • 2. Re: Parsing Section-Township-Range — Part 2
            bawilliamson

            Thanks, Beverly. I think I understand what you're saying. But I don't want to—and can't legally—change or substitute anything in that field. The wide variation and inconsistency of that information that is placed before the section-township-range part is part of the reality I am dealing with in these land descriptions.  I just want to create a calculation that will return as text all of the information in that field except that one "word" <e.g., 14-14E-15W>. This may indeed be one of those times when taking an hour to run a copy & paste script one time may be the most effective solution! Still am curious, though, if there are other calcs or scripts that might work. Thanks again.

            • 3. Re: Parsing Section-Township-Range — Part 2
              AlanStirling

              Hi BA

               

              Your quest for a calculation to separate the left-hand side of your text into another field is not very difficult (and I don't think it will take as long as an hour!).

               

              Firstly, 'Left ( Text ; Length of required text )' will give you what you want, but we need to calculate 'Length of required text'.

               

              Secondly, 'Length of required text' equals the overall length of the original string, less the length of the codes at the right-hand end (the length of which you can calculate because you have split them out already).

               

              So make a calc that reconstitutes the codes on the right, finds the length of these codes and deduct it from the overall length. This gives you the length of the remaining text. You may also have to add or subtract one to account for the separator char between the two parts.

               

              This should provide you with the variable length, left-hand side text, in a separate field.

               

              Best wishes - Alan Stirling, London UK.

              • 4. Re: Parsing Section-Township-Range — Part 2
                beverly

                don't change IN the field, use the test in your calcs that fill the other fields.

                Beverly

                • 5. Re: Parsing Section-Township-Range — Part 2
                  bawilliamson

                  Hi Alan,

                   

                  Thanks for your idea! Where this gets complicated is the fact that the length of the codes on the right as formatted right now constantly vary from 7 to 10 characters in length, depending on whether or not any particular Section, Township, or Range has a one-digit or two-digit number. I've thought about reformatting what I've got by pairing a zero with single-digit numbers wherever they occur, but am definitely not sure how to do that without running the risk of corrupting all of my data. I can certainly copy all the data into a new field for experimentation.

                   

                  Thanks again,

                   

                  Bruce Williamson