Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!umd5!brl-adm!adm!PAAAAAR%CALSTATE.BITNET@wiscvm.wisc.EDU From: PAAAAAR%CALSTATE.BITNET@wiscvm.wisc.EDU Newsgroups: comp.unix.questions Subject: Re: awk or sed question (break/fold) Message-ID: <8208@brl-adm.ARPA> Date: Tue, 7-Jul-87 22:38:58 EDT Article-I.D.: brl-adm.8208 Posted: Tue Jul 7 22:38:58 1987 Date-Received: Fri, 10-Jul-87 07:14:08 EDT Sender: news@brl-adm.ARPA Lines: 56 Art Werschulzwrote asking for a way to 'word wrap' text. About 2 months ago I needed to do something similar when preparing handouts etc for a class. I designed, coded, documented, and ported a program 'br.c' as an example for the class. It is more useful than I expected. In BSD Mail I use '~br -70' to quickly format messages. In vi you can ignore layout when editting and then reformat a paragraph with '!{ br'. The speed is magical. Another use is for multicolumn printing of a list: '!20! sortcat -nbr 20pr -3 -w70 -o10' I am now working on joining up lines that have been word-wrapped. Given 'jn' (join) and 'br' I will have a kind of poor person's nroff by 'jn oldbr newpr whatever' Has any one got a speedy program to unwrap word-wrapped text? I won't post 'br.c', 'br.1', etc as they are longer than previous examples. If any one wants source, manual pages, and/or full design documentation - contact me directly and I'll send the stuff back by email(inshallah). Here are a list of features/bugs: 1. 'br width' reads standard input and produces standard output(only). 2. No output line is longer than w characters. 3. Whole groups of whitespace characters are replaced by a newline(CR in ASCII). 4. It interprets tabs as 6 characters wide. 5. 'br' treats nonprinting characters as having zero width. Backspace causes problems. 6. Words that are longer than 'w' are hyphenated before the break. 7. 'br -width' and 'br width' do the same thing. 8. The default width is 76. Dick Botting, CSU San Ber'do 5500, State University Pkwy, San Bernardino, CA 92407 714-887-7368(voice), 714-887-7365(modem - login as guest) paaaar@calstate.bitnet paaaaar@ccs.csussc.edu paaaaar%calstate.bitnet@wiscvm.wisc.edu Disclaimer - I am only an egg.