10.0;fpatb (find_pattern_block), revision 1.0, 88/01/21
fpatb (find_pattern_block) -- Find blocks of text containing patterns.
usage: fpatb [-a|-x|-c] [-l n] [-lf]
[-b reg_expr1
[-e reg_expr2]]
[pathname... -p] reg_expr...
[-out pathname]
DESCRIPTION
fpatb reads blocks of text from its input files and writes them to its
output file(s) so that they meet the specified matching criteria. By
default, blocks of lines are separated by an empty line or by a line
containing only blanks. fpatb is similar to fpat (find_pattern) except
that if a pattern is found, the entire block of lines is copied to
output, rather than only the line in which the pattern occurs. Thus, it
is useful for searching mailing lists, bibliographies, and similar files,
where several lines are grouped together to form cohesive units.
ARGUMENTS
reg_expr (required)
Specify the regular expression to be used for matching
search. Each expression defines a text pattern, and you
can specify up to nine expressions with each fpatb
command. fpatb is case-sensitive; for example, "a" is
different from "A". For a description of regular
expressions used for pattern matching, type help patterns.
pathname -p (optional)
Specify the name of the file to be searched. If you
specify a pathname with this argument, you must follow it
with -p to separate the pathname(s) from the search
patterns on the command line. Multiple pathnames and
wildcarding are permitted. Blocks must be less than
15,000 characters.
Default if omitted: read standard input
OPTIONS
If no options are specified, any block containing a line that matches any
one of the regular expressions is considered a matching block.
-a Select only blocks containing lines that match all regular
expressions, in any order.
-x Select only blocks containing none of the regular
expressions.
-c Write only a count of matching lines, not the lines
themselves.
-b reg_expr1 Specify reg_expr1 as the block separator, instead of a
blank or empty line. Text blocks begin at lines containing
reg_expr1. If -b is specified and -e is not, reg_expr1
begins and ends the text block.
-e reg_expr2 Specify reg_expr1 to start a block and reg_expr2 to end a
block. Note that the -e option is used only in conjunction
with the -b option.
-l n Write only the first n lines of selected blocks. If a
block contains fewer than n lines, this option pads the
output block with blank lines.
-lf Display the name of the file being examined before
searching its lines.
EXAMPLES
$ fpatb address_list -p 01824 -out zip_list
$
Locate text blocks with the string 01824 in the file address_list and
write the results to zip_list.
SEE ALSO
More information is available. Type
help fpat For details about searching files for single lines
containing text patterns
help patterns For a description of regular expressions