# # AWK script to process the Waffle USENET group list, and produce the # USENET command text file (usenet.wrd). This file is then edited to # update the date in the header, and is then moved to \WAFFLE\WORDS # as USENET. # # Written by Tim Capps (tim@qed.tcc.com) - 6/8/91 # This program is hereby released into the Public Domain. Have fun! # # Usage notes: # # Any newsgroups which use the /junk switch must use lower case for 'junk' # and the /junk switch must be the FIRST (or only) switch on the line. # Any groups which you don't want listed (such as 'junk', 'control', # and newsgroups which aren't really fed, but need to be in the system's # master newsgroup list) should be down at the bottom of Waffle's USENET # file. Place a "#End public list" on a line by itself before the stuff # you don't want listed. The remainder of the USENET file will be # ignored. # BEGIN { print "USENET forums (quick reference, for details use: HELP FORUMS USENET)" > "usenet.wrd" print "[last update: 6/08/91]" >> "usenet.wrd" chars=0 last="" private=0 } $1 ~ /#End/ { private=1 # Stop processing if we see this } $1 !~ /#/ && $1!="DEFAULT" && $1!="" && $2!="/junk" { if (private==0) { # If we are starting a new hierarchy, do a newline. x=index($1,".") this=substr($1,1,x-1) if (this!=last) { printf "\n" >> "usenet.wrd" if (chars>0) printf "\n" >> "usenet.wrd" printf "*" # progress indicator chars=0 } else { printf "." # progress indicator } last=this # If we will overflow the line, do a newline if (chars+length($1)+1>79 || chars+26>79) { printf "\n" >> "usenet.wrd" chars=0 } printf "%s ", $1 >> "usenet.wrd" # Pad to the next column chars+=length($1)+1 if (chars<=27) { x=27-chars } else { if (chars<=53) { x=53-chars } else { # We just did the third column. Force a newline printf "\n" >> "usenet.wrd" chars=0 x=0 } } for (i=0; i> "usenet.wrd" chars++ } } } END { if (chars>0) printf "\n" >> "usenet.wrd" print "" }