4 Replies Latest reply: May 15, 2014 9:58 AM by Gillian _ RSS

    Text wraps to new line

    Gillian _

      Hi everyone,

       

      I have what's probably a very simple problem, but since I'm new to Monarch I just can't figure it out.  I'm working with a report that has a record for every employee, and since some employee names are long, their first name will wrap to the next line.  It ends up looking a bit like this:

       

      [font="courier"]Washington, George            64      16V

         ID: 999999

      Jefferson, Thomas             80 

         L.

         ID: 999998                                800

      Wilson, Woodrow               80   6

         ID: 999997  /font[/quote]I need to be able to capture the names.  I can get the last name with a floating trap, taking all the text that comes up to ", ".  I can also get the first line of the first name using this same floating trap, but of course I can't pick up the second line of the first name using the same trap.

       

      Any insight would be very much appreciated.  Sorry if this has come up before, I did try searching for similar topics first.

       

      Thanks!

       

      -Gillian

        • Text wraps to new line
          Grant Perkins

          Hi Gillian,

           

          This is one way there could be many.

           

          Trap the ID line as your detail line, for which you may as well use the "ID" as the trap.

           

          Crteae an append trap for the name line. Mark the appropriate fields. For the Name filed make a field as wide as the report allows on a single line. Right click the fields to get to "Field Definition". Select "Options" and change "End Field On" to 'minimum action only'. This will create a multi line block field. Odd spacing though perhaps with that sort of spacing on the second row.

           

          If  you need to reformat the name look at the LSPLIT and RSPLIT functions and possibly some of the other mannipulation functions available. I would not use the floating trap for this though it is an interesting idea but may not be reliable in all records. Not needed really.

           

          Let us know if you have any problems with this and if so what version of Monarch you are using.

           

          Best regards,

           

          Grant

           

            Originally posted by Gillian:

          Hi everyone,

           

          I have what's probably a very simple problem, but since I'm new to Monarch I just can't figure it out.  I'm working with a report that has a record for every employee, and since some employee names are long, their first name will wrap to the next line.  It ends up looking a bit like this:

           

          [font="courier"]Washington, George            64      16V

             ID: 999999

          Jefferson, Thomas             80 

             L.

             ID: 999998                                800

          Wilson, Woodrow               80   6

             ID: 999997  /font[/quote]I need to be able to capture the names.  I can get the last name with a floating trap, taking all the text that comes up to ", ".  I can also get the first line of the first name using this same floating trap, but of course I can't pick up the second line of the first name using the same trap.

           

          Any insight would be very much appreciated.  Sorry if this has come up before, I did try searching for similar topics first.

           

          Thanks!

           

          -Gillian /b[/quote]

           

          [size="1"][ July 08, 2003, 08:29 PM: Message edited by: Grant Perkins ][/size]

          • Text wraps to new line
            Tom Whiteside

            Gillian (and Grant), here's a caution - - multiple-line append fields can be really tricky to deal with - - especially if combined with multiple-line detail fields.  I understand that you talked of using single-line detail fields, but if I were you, I would use multiple-line detail fields for the Names (the same way as  Grant outlined for append fields) and footers for the ID Number fields.  Since there are (apparently) matching ID Number fields for each Name field, you would not have problems with one footer attaching to several detail fields.

             

            As Grant rightly pointed out, a judicious combination of LSplit and RTrim will concatenate any fragments of your Name fields.  If you find any stubborn spaces that won't disappear with RTrim, try Nick Osdale-Popa's inspired solution in this [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000099#000002"]post[/url].

             

            [size="1"][ May 19, 2006, 11:58 AM: Message edited by: Todd Niemi ][/size]

            • Text wraps to new line
              Grant Perkins

              Tom is absolutely right. In this case I have assumed that that the extra line only appears if the name wraps and that the extra part of the name is the only information on that line. It seemed a reasonable assumption.

               

              I have no problem with using the footer but it is, for my thinking, nice to keep it 'free' in case there is something else that it can be used for. But that is a personal preference!

               

              The more ways you discover to define what you need to do the greater the flexibility available to you. (And the more interesting the resulting understanding can become.    smile.gif[/img]   )

               

              There are probably at least a couple of other ways to get to where you want to get to that would work with your sample data but maybe not with ALL similar looking data. Such are the joys of report mining.

               

              Grant

               

                Originally posted by Tom Whiteside:

              Gillian (and Grant), here's a caution - - multiple-line append fields can be really tricky to deal with - - especially if combined with multiple-line detail fields.  I understand that you talked of using single-line detail fields, but if I were you, I would use multiple-line detail fields for the Names (the same way as  Grant outlined for append fields) and footers for the ID Number fields.  Since there are (apparently) matching ID Number fields for each Name field, you would not have problems with one footer attaching to several detail fields.

               

              As Grant rightly pointed out, a judicious combination of LSplit and RTrim will concatenate any fragments of your Name fields.  If you find any stubborn spaces that won't disappear with RTrim, try Nick Osdale-Popa's inspired solution in this [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000099#000002"]post[/url]. /b[/quote]

               

              [size="1"][ May 19, 2006, 11:59 AM: Message edited by: Todd Niemi ][/size]

              • Text wraps to new line
                Gillian _

                Thanks!  The multi-line detail and footer for the ID number ended up working just fine.   smile.gif[/img]