Parsing Long text string into smaller strings

Maloney, Charlie Charlie.Maloney@Cognos.com
Mon, 24 Jul 2000 22:06:39 -0400


Try the WRAP option.  Seems to work pretty much as you need.  As in:

Report & 
  Employee &
  Last_Nane &
  Hire_Date &
  Marital &
  Supervisor_Notes Wrap 39

There's a minor problem; don't know if you can live with it...

If a string ends on (in this example) position 39, then the space(s)
after the string appear at the beginning of the next line.  The left 
margin of the column containing your long text description could seem
a wee bit ragged.  See Customer_no 1001, Site_no 5 in this example:

Q U I Z   (PowerHouse  8.21.D)
Copyright 1999 COGNOS INCORPORATED
Licensed PH8-TEMPORARY for customer: 0712570003 COGNOS WINNT DEMO

> Access Customer_Sites in GO_4GL
> Report &
>   Customer_no &
>   Site_no &
>   Address1 Wrap 15 Skip 2
> Go
24-JUL-2000                    The Great Outdoors

  Customer No.  Site  Address1
                 No

       1001        1  453 Old Creek
                      Road

       1001        2  45 East Lane

       1001        3  275 Sparks Road

       1001        4  61 Cathcart

       1001        5  Weimarerstrasse
                       35

       1001        6  1917 St.
                      Laurent Blvd.

I have NOT reported this as a bug.

So, at least try it.  Then ignore this suggestion if:

  1:  You need a perfect left margin, or
  2:  You need all those underscores to the left of the text column.

In those cases, you'll need a more diligent lister.

As usual, this is my opinion only, and does not in any way reflect
the statements or positions of Cognos, etc., etc., blah, blah...

-----Original Message-----
From: GGrimm@pcc-structurals.com [mailto:GGrimm@pcc-structurals.com]
Sent: Monday, July 24, 2000 7:04 PM
To: powerh-l@sphere.swau.edu
Subject: Parsing Long text string into smaller strings


     I would like some "elegant" solution to my challenge.  If any of you 
     have something to suggest, please provide psuedo-code either to the 
     list or me privately.
     
     The QUIZ report has a long text description field of 360 characters, 
     consisting of from 0 or more words separated by spaces.  I need to 
     parse them into words in 39 character strings.  The math shows the 
     most strings would be 10.  If a word exceeds 39 characters (a user 
     error) we would parse at 39 characters, not a space.
     
     A report mock up would look something like the following:
     
     Employee  --Last Name--  Hire Date  -Marital-  --Supervisor notes---
     
     080123    SMITH          01/15/92   MARRIED    This employee has ..
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ and furthermore, ...
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ with never any .....
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ and brings flowers..
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ on occassion even...
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ buys lunch and has..
     _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _ alway done a good job.
     
     (If the Supervisor notes don't line up under the report heading, 
     please use your imagination.)  Thanks for any ideas.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.