indxcomp.icn: Program to assist in index compilation

June 23, 2000; Ralph E. Griswold
This file is in the public domain.
This program is designed to assist in the compilation of indexes.

It takes input from standard input and expects lines that either consist
of an integer (taken to be a page number) or text (to be indexed on
page of the last page number.

The idea is to go through the work to be indexed and create a file
in which the page number is entered followed by items to be indexed
on that page.  Page numbers (which need not be numeric) are prefixed
by "=".  For example, the file might consist of

     =1
     warts
     moles
     scratches
     =2
     scratches
     dents
     bumps
     =3
     hickies

The output of this program for that input is:

     bumps, 2
     dents, 2
     hickies, 3
     moles, 1
     scratches, 1, 2
     warts, 1

Leading blanks are stripped from index items.  Therefore to enter
an index item that begins with "=" start with " =" instead.

This program is unsophisticated.  It contains no provisions for
formatting index entries nor any way to indicated inclusive page
ranges.  Such things have to be done in post-processing.

non-numeric page "numbers" appear before numeric ones.

Obviously, there is room for improvement, embellishment, and creeping
featurism.

Source code | Program Library Page | Icon Home Page