Gaffaweb > Love & Anger > 1989-10 > [ Date Index | Thread Index ]
[Date Prev] [Date Next] [Thread Prev] [Thread Next]


Re: retraKTion; and admoniKTion

From: heath@cs.jhu.edu
Date: Fri, 09 Jun 89 12:29:25 EDT
Subject: Re: retraKTion; and admoniKTion

  Currently, there are about 11 meg in the love-hounds archives. It is
very interesting to sit down and just read them. For reference purposes,
however, they are poorly organized. Here are two awk scripts to help make
searching through the archives a little easier. If you know awk, you
should be able to customize them with little trouble.

  After ftp'ing the archives execute the command:

awk -f awkscript 0* >output-file

 where 'awkscript' is the name of one of the awk script files below, p.awk
or a.awk, and 'output-file' is the file in which you wish all the results
to be placed.

  Here is the first script, p.awk. It will output all paragraphs in all
postings that contain a given phrase. You should change /bootleg/ to the
phrase you want to find.

BEGIN {indx = 0; found = 0}
  ($0 < "!") { if (found == 1) for (i=1;i<=indx;i++) print st[i];
	       found = 0; indx = 0}
  { indx++ ; st[indx] = $0 ; if ($0 ~ /bootleg/) found = 1}


The second script, a.awk,  outputs all articles that contain a given phrase.
Again, you should change /bootleg/ to the phrase you would like to find.

BEGIN {indx = 0; found = 0}
  ($0 ~ /^From/) { if (found == 1) for (i=1;i<=indx;i++) print st[i];
	       found = 0; indx = 0}
  { indx++ ; st[indx] = $0 ; if ($0 ~ /bootleg/) found = 1}


You will still have a lot of reading to do, but this may simplify the task
of searching through the archives a little.

--
Dave Heath			heath@crabcake.cs.jhu.edu