Text formating

fredex fredex at fcshome.stoneham.ma.us
Tue Apr 27 00:05:41 UTC 2004


On Mon, Apr 26, 2004 at 09:48:12AM -0500, Bill Gradwohl wrote:
> I'm looking for a utility that will change:
> 
> 	Mary had a\n
> 	little\n
> 	lamb, it's fleece was white\n
> 	as snow.\n
> 
> To:
> 
> 	Mary has a little lamb, it's fleece was white as snow.
> 
> Further, I'd like it to recognize the period at the end of a sentence as the
> only possible place where a new line might be appropriate as a separator
> before the next paragraph.
> 
> What I'm trying to do is format pages of text that have arbitrary newline
> characters at position 72 and remove all of them except the ones that
> separate paragraphs. The fmt utility can fix up the sentence above, but it
> inserts newlines of its own. 
> 
> Does such a utility exist?

There's a little utility named "fmt" that comes with the editor "elvis"
that is useful for reformatting stuff inside the editor. Not sure if it
does the thing you require with periods, but it otherwise does a nice job
of reformatting blocks of text. You can find elvis at:

	ftp.pdx.cs.edu/pub/elvis

Fred

-- 
---- Fred Smith -- fredex at fcshome.stoneham.ma.us -----------------------------
   "For the word of God is living and active. Sharper than any double-edged 
   sword, it penetrates even to dividing soul and spirit, joints and marrow; 
              it judges the thoughts and attitudes of the heart."  
---------------------------- Hebrews 4:12 (niv) ------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040426/9be8bc3c/attachment-0001.sig>


More information about the fedora-list mailing list