On Mon, Dec 10, 2018 at 08:37:21AM -0800, Charles Mills wrote:
> This is not truly a mainframe question but I am sure everyone can see the
> mainframe relevance and why it is a mainframe problem for me. Some of you
> mainframers may have encountered the same problem.
> 
> I have a text file on Windows with CR-LF only at paragraph boundaries. Some
> of the lines are several thousand characters long.
> 
> I would like to break the lines (intelligently -- at an English word
> boundary) no later than column 72. 
> 
> Can anyone suggest a good method? This is a one-time chore so I don't want
> to buy a product or install something off the CBT. I have all of normal SDSF
> of course plus Notepad++ on Windows.

A) Install Cygwin on Windows box and experiment with par and/or
fmt. See "man par" and "man fmt" for details or look for online docs.

Example:

  fmt -w 72 <LONGTXT.txt >SHORTTXT.txt

B) load it in Emacs editor and select all lines you want to reformat
and tap Esc tap "q". Will work wonders if every long line is separated
by blank/empty line, otherwise will concatenate them. Needs some
experimentation before one gets used to its ways - for example, Esc-q
(M-q in Emacs speak) preserves indentation etc. It is meant for
paragraph reformatting, I think. Works like a charm with reformatting
bullet/number/alfa/dash lists etc in some modes which recognise such
textual constructs.

HTH

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.      **
** As the answer, master did "rm -rif" on the programmer's home    **
** directory. And then the C programmer became enlightened...      **
**                                                                 **
** Tomasz Rola          mailto:tomasz_r...@bigfoot.com             **

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to