5 Replies Latest reply: Mar 13, 2015 7:12 AM by Ben Anderson RSS

    Having trouble with Floating Traps

    Ben Anderson

      I am fairly new to Monarch and mostly self taught at this point. But I am having an issue grabbing some data from a PDF file.


      I have a set of invoices and 99% of them, the model I created pulls in the data just fine. However, there are about 17 files that have a slight difference. Mainly the dollar sign I was using in my trap moves a space to the left or to the right. I believe that a Floating trap is the way to go here (unless someone has any ideas), but I cannot seem to get it to work for all 17 files. Again, I am fairly new to Monarch so please be gentle with me. Ha ha ha.


      But seriously, any help anyone can offer would be greatly appreciated.



        • Re: Having trouble with Floating Traps
          Olly Bond

          Hello Ben,


          (If you want us Monarch Experts to build a model for you, we can, but we charge a modest fee for this.)


          Floating traps can be tricky - as the trap definition template has to match the sample line exactly, so editing the template to handle errors can be a pain. They also prevent you from using the Numeric Or | trap. So unless this $ sign is crucial - unless it's the only way you can get a handle on the total line of the invoice - my first thought would be to try to rework the template so it doesn't need it.


          You might find the decimal point, or the pattern of numbers and spaces like .ÑÑß let you avoid it.


          Best wishes,



            • Re: Having trouble with Floating Traps
              Ben Anderson

              Thank you, Olly. Below is the section of invoice I am concerned with.



                  Description                                  Total  Sales Tax  Tax %

                      Grass Cut Initial Lot 90 x 60                                        

                    1 EACH @ $100                            $100.00        $.00    .00


                    9 EACH @ $1.05                              $9.45        $.00    .00



              Previously I had the Trap and Sample lines like this:



                   Description                                   Total   Sales Tax   Tax %  

                      Grass Re-cut Lot 120 x 80                                             


              Then I set up 2 trap lines based on that. One for the Description line:

                      Grass Cut Initial Lot 90 x 60                                        

              And one for the cost line:

                    1 EACH @ $100                            $100.00        $.00    .00

              From there I was parsing out the data needed for each field in the report (Description, Total, Sales Tax, Tax % and Qty)

              But with this handful where the dollar sign is different is where I am getting the issue. With the above in mind, what would you suggest to put in the trap line / sample text line in order to make the floating trap work? I tried the suggestion above in place of the dollar sign, but could not get it to work.

            • Re: Having trouble with Floating Traps
              Grant Perkins



              Have you experimented with the PDF interpretation settings to see if you can get more consistent results that allow all files to be extracted by your trap?


              PDF writing engines can be challenging to double guess.


              It is not uncommon to have to resort to grabbing entire lines and then work out how to "slice and dice" them using Monarch text manipulation functions.


              Which version of Monarch are you using?