reformat(1)

NAME
reformat - rearrange a text without cutting words
                    (Rev. May-2008)

SYNTAX
reformat [-c|-d|-f|-j] -p [-[bsep_list] [ -[w|W] width] [-[i|I] indentation] [file...]

DESCRIPTION
The reformat command takes a text from file, or the standard input, and re-arranges the text within width bytes, and unlike the fold(1) program without cutting the words. Lines breaks are also generated for lines having a punctuation character in the leftmost byte, or when the amount of indentation on the input text is larger than usual. reformat may also add a constant indentation specified by the -i option.

With the -I option, the leftmost indent bytes of each line are considered as an identifier, for which these bytes are reserved; in other terms, these left bytes contain either the identifier, repeated with the -f (fill) option, or blanks.

Note that the number of consecutive blanks is generally not kept, except with the -c or -d option.

OPTIONS

-b asks to break lines when one of the chars in the list is immediately followed by a newline. The list of these characters, in the case of a -b option without a list, is composed of the 2 characters : (colon) and ) (right parenthesis)

-c is the continuation only option: only continuation lines from input lines larger than width are indented. Note that, with this option, the number of consecutive blanks is not changed.

-d is the definition option, assuming a set of definition word followed by an explanation: lines starting by non-blanks are not indented (i.e. left-flushed), and are followed by enough blanks to fill the indentation; all lines starting by one or more blanks are assumed to be a continuation of the explanation. Note that, with this option, the number of consecutive blanks is not changed.

-f is similar to -d (left-justified lines are kept left-justified), but the leftmost I bytes are repeated on each continuation line instead of being blank.

-i indentation reformat starts each line with indentation blanks. Its default value is zero (no indentation)

-I indentation assumes that the leftmost indentation bytes are reserved for an identifier.

-j asks to justify the text, i.e. insert blanks to adjust both left and right margins.

-p assumes input items made of paragraphs, i.e. full paragraphs are reformatted.

-w width defines the width of the text. Its default value is 80. The maximal length of each line (linesize) is width+ indentation

-W width defines the maximal length of each line (linesize).

RETURNED STATUS
The reformat command returns 0 in case of success, and non-zero when bad options or unreadable files are found.

EXAMPLES

1.  The following text
    Hello, here is a text that I would like to reformat.
       Effectively, the indented lines mean "starting a new paragraph";
    but, caution, I've a list:
    => here is an item (the first)
    => this is also an item
       but not this

gives with reformat -i4 -w60 the following result:
    Hello, here is a text that I would like to reformat.
    Effectively, the indented lines mean "starting a new
    paragraph"; but, caution, I've a list:
    => here is an item (the first)
    => this is also an item but not this

2.  The following text
    WGA J0043.3-2638 Since being selected for the DXRBS sample,
    WGA J0043.3-2638 this source was observed by Cristiani et al.
    WGA J0100.1-3337 The single emission line, which we classify as Mg II at
    WGA J0100.1-3337 z=0.875, is clearly broad (FWHM=2900km/s),
    WGA J0100.1-3337 but its equivalent width is close to 10A.

gives with reformat -I17 -W50 the following result:
WGA J0043.3-2638 Since being selected for the
                 DXRBS sample, this source was
                 observed by Cristiani et al.
WGA J0100.1-3337 The single emission line, which
                 we classify as Mg II at z=0.875,
                 is clearly broad (FWHM=2900km/s),
                 but its equivalent width is close
                 to 10A.

SEE ALSO
acut(1) fold(1)