[net.sources] Building permuted index of arpa digests

mkg@lzwi.UUCP (Marsh Gosnell) (10/30/85)

Here's a shell procedure that keeps track of the topics in the ARPA digests
and builds a permuted index of them for printing.  It is written for the
info-mac digests but should work with any of the other digests with a
little tweaking.

The shell prints digests it hasn't seen before, strips off the topic
information (saving it in a file), and computes and prints a new permuted
index using the topic information that has been saved for all digests the
shell has seen.

The advantage of this shell is that you can keep printed copies of the digest
in a notebook rather than hoarding disk space while keeping the ability to
build a cumulative permuted index that include ALL of the digests you have
long ago printed and removed.

Enjoy!!
  Marsh Gosnell  lzma!mkg


# Make a file in the xref subdirectory for each digest containing topics.
# Print the file if we haven't seen it before.

# If we wanted to, we could remove the digest after extracting the topics.

# Assumes that the only files in the current directory that start with 'v'
# are the digests.

for i in v*
do
	if [ ! -f xref/$i ]
	then
		pr -o20 $i | opr -fx2on1 -2
		sed -e '1,/^Today/d' -e '/^------/,$d' -e "s/^/$i /" -e 's/  */ /g' < $i > xref/$i
	fi
done

# now make a perverted index of what we've got
cd xref
cat v* | ptx -f -r -w 83 | mm -mptx -Tlp -rW90 - | opr -fx2on1 -2