🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #643

Re: Wanted: SIMPLE .newsrc sorter

#643
From: Ian G Batten
Date: Thu, 26 Sep 1991 08:50
53 lines
1705 bytes
In article <36690@hydra.gatech.EDU> gt4824a@prism.gatech.EDU (Paul Beker) writes:
> I am looking for some simple way to sort my .newsrc, without having to

Mine was a quick and dirty perl script.  The first I wrote, I would
claim in my defense.  use it as ``newsorder < .newsrc > new-newsrc''.

#!/usr/local/bin/perl

@lines = <>;

while (<DATA>)
{
  chop;
  next if /^#/ || /^$/;
  $pat = $_;
  %mark = ();
  print join ("", sort grep (eval $pat && ++$mark{$_}, @lines));
  @lines = grep (!$mark{$_}, @lines);
}

print join ("", @lines);

__END__
/^se.*:/
/^fulcrum.*:/
/^talk.politics.soviet:/
/^midlands.*:/
/^bt.*:/
/^uk.*:/ && !/politics/
/^eunet.*:/ && !/politics/
/^news.*:/
/^talk.bizarre:/
/^talk.origins:/
/^comp.unix.*:/
/^comp.lang.perl:/
/^comp.*:/ && !/^comp.lang.c:/ && !/^comp.arch:/
/religion.*:/
/^talk.*:/
/^gnu.*:/
/^misc.*:/
/^rec.audio.*:/
/^rec.music.*:/
/^rec.arts.*:/
/^rec.*:/
/politics.*:/
/^sci.*:/
/^soc.*:/ && !/men:/
/^alt.*:/
/^soc.*:/
/^comp.arch:/
/^comp.lang.*:/
/:/
/!/
Technical Details
Message-ID: <T!`|#!*@uzi-9mm.fulcrum.bt.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!unido!mcsun!ukc!axion!uzi-9mm.fulcrum.bt.co.uk!igb
References: <36690@hydra.gatech.EDU>

Show Full Headers
Complete Article Headers
Message-ID: <T!`|#!*@uzi-9mm.fulcrum.bt.co.uk>
Subject: Re: Wanted: SIMPLE .newsrc sorter
Date: Thu, 26 Sep 1991 08:50:17 +0000
From: I.G.Batten@fulcrum.bt.co.uk (Ian G Batten)
References: <36690@hydra.gatech.EDU>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!unido!mcsun!ukc!axion!uzi-9mm.fulcrum.bt.co.uk!igb
Newsgroups: news.software.readers
Sender: news@fulcrum.bt.co.uk (News with an UZI)
Organization: Fulcrum Communications Ltd
Lines: 53