4 Replies Latest reply on Jul 5, 2013 1:04 PM by WesleySantiago

    Getting Data out of a paragraph and Entering in a Particular Field

    MichaelLindner

      Title

      Getting Data out of a paragraph and Entering in a Particular Field

      Post

           I've created a fillable pdf form that after complete, it generates a QR code at the bottom of the form that has the field info in that QR code.  I've also created a FMP data base that when you push the scan button on the layout (On filemaker go) is opens another app, scans the QR code, then goes back to filemaker go, and drops all that information in one field.  I've made it were most of the fieldsother fields  will drag the correct information out of the scanned field, but I have a couple fields (shipping address, and description) that are different lengths and different numbers of words every time.  Any Suggestions?

        • 1. Re: Getting Data out of a paragraph and Entering in a Particular Field
          WesleySantiago

               I'm assuming your decoder program can export your entire "form scan" into one field as text.

               However, you state, "and drops all that information in one field," without detailing the data you will have to eventually manipulate, inside FM.

               I can also assume your "form scan" is filled with a mix of numbers, and text... but I'm not assuming further because your goal(s) are very vague at this point.

          • 2. Re: Getting Data out of a paragraph and Entering in a Particular Field
            MichaelLindner

                 You are correct so far. I have one field that all the scanned information drops into. The info includes dates numbers and text. The info all imports in the same order each time. Here is an example of what the info would look like:


                  

            12/3/13  7.00   Yes  7/12/13   UPS   Michael Scott 1201 Cape Coral FL 32901  97.00  13.00  11/21/13  ethics course book manual  19. 


                  

                 I can get fields like "carrier" to grab ups, and "date shipped" to grab 12/3/13, and  
                 "Cost" to grab 97.00. But the field " ship to" that would include: Michael Scott 1201 Cape Coral FL 32901 or the description field "material" that would include: ethics course book manual are what I'm having the question about. The number of words and characters changes each time so I'm try to figure out how to capture that text and get it into the field. 


                  

                 Thanks 

            • 3. Re: Getting Data out of a paragraph and Entering in a Particular Field
              schamblee

                   The address starts at one position pass the carrier and ends right before the cost.  Take the endposition which is right before the cost and subrtract that from the start position which is right after the carrier.  68-28=40 which gives you the length of the address. then use

                   Middle (TheText ; $StartPosition ; $theLength )                $StartPosition would be 68 and then $theLength would be 40.

                   This should also work for the description field.  Start would be at the end of date shipped.  The end would be the length of all the text 120-89=31 would be the length of the title.

                   I spectulate that you know these position because you extracted the text around these fields.  If you don't know the positions then you may have to use a symbol or sign to indicate the beginning and end then you the position function to get the exact position to start and end your extraction.

              • 4. Re: Getting Data out of a paragraph and Entering in a Particular Field
                WesleySantiago

                     If you can grab the date and the cost as fields, why can't you import the address line as a field, just the same?

                     If your decoder program is giving you flat-file exports of your data then you need to perform a function called regular expressions on your pre-Filemaker data. To my knowledge, FM doesn't support this directly.

                     The tools you need are either sed, AWK, grep, or PERL, if you want to try this task on your own.

                     If you have a massive project with lots of reoccuring data I would recommend PERL over the other options as it has the most flexibility. You may have to see a programming consultant familiar with database parsing.