View previous topic :: View next topic
|
Author |
Message |
sarav_viveka
New User
Joined: 18 Jan 2007 Posts: 2 Location: chennai
|
|
|
|
The input text string has length of 200 must be broken down into text blocks of 40 characters . Each break of text must not be done in the middle of a word. If the last word does not fit into the end of the 40 character string, that word must be cut and then pasted into the start of the next 40 character string.
Total number of 40 character strings are to be calculated and sent to the output.
Each 40 character string must have a corresponding row number sent to the output.
Can you please tell me how to do it UNSTRING command |
|
Back to top |
|
|
balakrishna reddy.bala
New User
Joined: 15 Sep 2010 Posts: 17 Location: india
|
|
|
|
Hi,
Did somebody challenged you to do it using unstring!!
If not you can do it using reference modification.
Quote: |
Each 40 character string must have a corresponding row number sent to the output.
|
you want to accommodate the row number as well in the 40 bytes?? |
|
Back to top |
|
|
sarav_viveka
New User
Joined: 18 Jan 2007 Posts: 2 Location: chennai
|
|
|
|
i have to accommodate the row number as well as 40 bytes. But i wants to know How to check Each break of text must not be done in the middle of a word. If the last word does not fit into the end of the 40 character string, that word must be cut and then pasted into the start of the next 40 character string Using REFERENCE MODIFICATION |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Look at the 40th byte. If it is a space, move all 40 bytes. If it is not a space, go backwards to find the last space before the 40th byte. Move bytes 1 through wherever the space is, then start again from the character after the space. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
Back to top |
|
|
|