fmt: How to skip some text?

Alan Jackson ajackson
Mon May 17 11:54:13 PDT 2004


It's a bit more work, but you might be able to do that with the perl
module Text::Balanced or Text::Autoformat


On Sun, 28 Sep 2003 07:42:48 -0400
Joel Hammer <Joel at hammershome.com> wrote:

> Thanks for the suggestion.
> 
> > !Gsed '/^  /d' | fmt -w 130<ENTER>
> 
> This doesn't do what I need, however.
> 
> The newly formatted document will only contain lines which didn't begin
> with a blank. Lines beginning with a blank are deleted.
> 
> I did try a sed solution with fmt, though. Please see my post:
> "Bug in fmt?" elsewhere on this list.
> 
> Joel
> 
> > On Sat, Sep 27, 2003, Joel Hammer wrote:
> > >I want to use fmt in vi to format text, eg:
> > >          :1,$ ! fmt -w 130
> > >
> > >Without vi, this command would look like:
> > >          cat file ! fmt -w 130
> > >
> > >I want it to format everything except lines which begin with at least
> > >two blanks, like this:
> > 
> > Extend your command to pipe it through sed first:
> > 
> > This will format the entire document
> > Go to the top of the document (1G);
> > !Gsed '/^  /d' | fmt -w 130<ENTER>
> > 
> > Bill
> > --
> > INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
> > UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
> > FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
> > URL: http://www.celestial.com/
> > 
> > More laws, less justice.  -- Marcus Tulius Ciceroca (42 BD)
> > _______________________________________________
> > Linux-users mailing list
> > Linux-users at mail.linux-sxs.org
> > Unsubscribe/Suspend/Etc -> http://mail.linux-sxs.org/mailman/listinfo/linux-users
> _______________________________________________
> Linux-users mailing list
> Linux-users at mail.linux-sxs.org
> Unsubscribe/Suspend/Etc -> http://mail.linux-sxs.org/mailman/listinfo/linux-users


-- 
-----------------------------------------------------------------------
| Alan K. Jackson            | To see a World in a Grain of Sand      |
| alan at ajackson.org          | And a Heaven in a Wild Flower,         |
| www.ajackson.org           | Hold Infinity in the palm of your hand |
| Houston, Texas             | And Eternity in an hour. - Blake       |
-----------------------------------------------------------------------


More information about the Linux-users mailing list