2 Replies Latest reply: May 15, 2014 10:07 AM by Grant Perkins RSS

    Dynamic Multi Line Trap - Causing me pain

    Diony _

      Having a hard time with a dynamic line trap.  Here is what I am trying to trap.


      01/04/10    SERIES KEY: GREENV09     CURRENCY:USD                              

                 GENERATED PAYMENT # 01/04/10-562-0001                    1,522.52-   

                 MISCELLANEOUS DISBURSEMENT,DUE: 01/04/10                             

                 PAYEE : GRAYSON CLO LTD                                              

                 P#12/30/09-578-110 TAX WITHHOLDING REFUN                             

                 W8 RECEIVED                                                          

                 TX# 01/04/10-562-0002              03.08                             


      01/05/10    SERIES KEY: NORTHT08A    CURRENCY:USD                              

                 GENERATED PAYMENT # 01/05/10-275-0001                   19,791.69-   

                 MISCELLANEOUS DISBURSEMENT,DUE: 01/05/10                             

                 PAYEE : MTN/FLX/CP ---CEDE & CO                                      

                 ADD'L INT FOR CUSIP 662826EG7 HOLDER:2                               

                 TX# 01/05/10-275-0062              03.08                             


      After the "PAYEE : " line the lines are rather random.  I want to trap each line as line 1, line 2 or line 3.  Sometimes there is only 1 line, sometimes there are up to 3.  I can't quite figure out how to get those.


      I will also be trapping the lines above but they are easier since they start with words that are standard.


      Thanks in advance for your help.

        • Dynamic Multi Line Trap - Causing me pain
          Data Kruncher

          Hi Diony,


          Is there always a blank line between the records? I'll assume that this is the case.


          The way to capture those lines is with a technique we call the "guru" trap. This will be an append template.


          Start with the sample being as large as you expect to need, in your case three lines.


          Now set the trap for this template to be exactly the same as you what you used for your detail template trap.


          Paint the first line of the sample as a single field, and on the advanced properties of the field definition, select string payee anywhere in the previous line, and set the field to end on End of Left Justification.


          This will give you one single field that contains all of the lines. Then to break out the data, you'll need to use some calculated fields to properly extract the data. The TextLine function will be key at first, to isolate what's in line 1, line 2 and line 3. Once you have separated the lines into fields, then use those fields in other calculations.


          Enough to get started?

          • Dynamic Multi Line Trap - Causing me pain
            Grant Perkins

            Hi Diony,


            From what you describe you have no problems getting the first 4 lines but line 5 onwards can appear in any order. I assume when yuo say you just want to get Line 1, Line 2, Line 3, of the extra lines it does not matter which type of line appears in which position?


            If so  ....


            Make a 5 line sample for the detail template.


            Get the field in the first 4 lines.


            For the 5th line paint a single field the width of the report (or at least wide enough to cover anything that might appear after line 4.)


            Go to the Advanced properties for the field and and set the field to START after the last defined field in the templae and to END after, say, End of Left justification. Or what ever else might be suitable. This will make it a multi-line field.


            No go to the table. Create "Line 1", "Line 2", etc., using the TEXTLINE function in calculated fields for each of the extra lines that there may be.


            That's it .... unless you need to group like data in the fields, in which case come back and tell us and we can work on things further.