5 Replies Latest reply: May 15, 2014 9:58 AM by Grant Perkins RSS

    Multiple Line Trap

    TonyD _

      Can anyone help please!

      I am having problems trapping the details in [] and putting them into seperate fields in a table.

       

      Number    Name   Details

      00001       John    Blocked Drain

      00002       Dave    Blocked Pipe

      00003       Mick    Cracked Drain

           

           

           

      00004       Tony    Cracked Drain

      00005       Mike    Blocked Drain

       

       

      I have managed to trap the information but can't get them into seperate columns associated to the correct record in the table e.g

       

      00003 Mick Cracked [0000384566] etc

       

      Thanks

      Tony

        • Multiple Line Trap
          Grant Perkins

          Hi Tony,

           

          Looks like  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000243"]this[/url] solution might suit for your problem.

           

          If the extra code lines really start at the first position on the line you may need to do some manipulation of the resulting data. If they don't use the blanks as a 'preceding string'.

           

          If they DO start at the begining of the line you need to use [ as the preceeding string and make it a multi line field. This will mean that the opeing [ of each code line is missing when the field with all the codes (however many lines are found but limited to the max size allowed for the field) is created. If you need to separate the fields into individual cells, try the LSPLIT (or similar) function. Once split, or even if not to be split in the end, the [ can be added back to the data by concatenation.

           

          See how you go and let us know if you get stuck anywhere.

           

          Grant

           

            Originally posted by TonyD:

          Can anyone help please!

          I am having problems trapping the details in [] and putting them into seperate fields in a table.

           

          Number    Name   Details

          00001       John    Blocked Drain

          00002       Dave    Blocked Pipe

          00003       Mick    Cracked Drain

               

               

               

          00004       Tony    Cracked Drain

          00005       Mike    Blocked Drain

           

           

          I have managed to trap the information but can't get them into seperate columns associated to the correct record in the table e.g

           

          00003 Mick Cracked [0000384566] etc

           

          Thanks

          Tony /b[/quote]

           

          [size="1"][ May 19, 2006, 12:03 PM: Message edited by: Todd Niemi ][/size]

          • Multiple Line Trap
            TonyD _

            Thanks for your reply the text in between the []is not at the start of the line so spaces will work. I have been able to trap and the text is highlighted in the report but the problem is only the first line is pulled into the table and the 2nd 3rd and 4th lines are not? Is there something else that has to be done to bring the other line sinto the table.

             

            Thanks

            Tony

            • Multiple Line Trap
              Grant Perkins

              Hi Tony,

               

              OK, Sounds like you have created your append (or whatever) trap in the same line as your detail, positioned a field where the fields will be in lines 2, 3,4, etc. and set the 'Start Field On' option to 'Preceding String' with the string being a number of blanks.

               

              In that case the only thing that might be missing is to set the option 'End Field On' in order to pick out each occurence in every intervening line until the next template detail line occurs. I normally use the 'Minimum Action' option but it sounds like the layout of your report may enable use of one or two of the others. Have a play and see what you think works best.

               

              And that should be it except for splitting the multi-line field back into separate columns if you need to do so.

               

              Hope it all works.

               

              Grant

               

                 Originally posted by TonyD:

              Thanks for your reply the text in between the []is not at the start of the line so spaces will work. I have been able to trap and the text is highlighted in the report but the problem is only the first line is pulled into the table and the 2nd 3rd and 4th lines are not? Is there something else that has to be done to bring the other line sinto the table.

               

              Thanks

              Tony /b[/quote]

               

              [size="1"][ July 21, 2003, 07:50 AM: Message edited by: Grant Perkins ][/size]

              • Multiple Line Trap
                TonyD _

                Thanks for your help. I decided to use the start field on preceding string option and put a ( in and then ended on line count 4 as i know there are only ever 4 lines. Works fine!

                 

                Thanks

                Tony

                • Multiple Line Trap
                  Grant Perkins

                  Excellent news and thanks for the update.

                   

                  Grant

                   

                  Originally posted by TonyD:

                  Thanks for your help. I decided to use the start field on preceding string option and put a ( in and then ended on line count 4 as i know there are only ever 4 lines. Works fine!

                   

                  Thanks

                  Tony /b[/quote]