patfetch.icn: Program to extract patterns from a file

July 22, 1993; Ralph E. Griswold
This file is in the public domain.
This program accepts a list of integer specifications for patterns
as the appear in order in a file of patterns.  The selected patterns
are written to standard output, but not until the end of the input
specifications.  The name of the pattern file is specified on the
command line.

Each line of input can be a comma-separated string of either integers
or integer ranges.  Blanks after commas are tolerated.  An example of
input is:

     1-3, 5
     10
     13-17
     8

which specifies the patterns 1, 2, 3, 5, 8, 10, 13, 14, 15, 16, and 17.

Note that the integers need not be in order, although within a range,
the lower bound must precede the upper bound.

Source code | Program Library Page | Icon Home Page