From jik@athena.mit.edu Sun Jul  5 22:39:55 1992
Newsgroups: news.admin
From: jik@athena.mit.edu (Jonathan I. Kamens)
Subject: Re: Need .newsrc cleanup tool
In-Reply-To: analyst@netcom.com's message of Sun, 05 Jul 92 22:27:44 GMT
Nntp-Posting-Host: pit-manager.mit.edu
Organization: Massachusetts Institute of Technology
Date: Mon, 6 Jul 1992 00:21:41 GMT

In article <q!5l5yr.analyst@netcom.com> analyst@netcom.com (David Sternlight) writes:

   Like some others, when I see such stuff getting out of hand, I go in
   manually and change 1-5, 7, 9-11, 13 to 1-13 (for example). It would be
   good if there were a tool to do that automatically--take the first and last
   number in a newsgroups's .newsrc entry, and replace the stuff in between with
   a dash.

sed 's/\([:'\!']\) *\([0-9]*\).*[,-]\([0-9]*\)$/\1 \2-\3/' \
	< .newsrc > .newsrc.new

You can reduce the size of your .newsrc even more by eliminating *all*
numbers on newsgroups to which you do not subscribe:

sed -e 's/\([:'\!']\) *\([0-9]*\).*[,-]\([0-9]*\)$/\1 \2-\3/' \
	-e 's/'\!'.*/'\!' /' \
	< .newsrc > .newsrc.new

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
    (Send correspondence related to the news.answers newsgroup
	{and ONLY correspondence related to the newsgroup}
		 to news-answers-request@MIT.Edu.)

