Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!felix!trwrb!desint!geoff From: geoff@desint.UUCP (Geoff Kuenning) Newsgroups: news.software.b Subject: Another way to count news articles by date Message-ID: <286@desint.UUCP> Date: Thu, 15-Jan-87 03:01:44 EST Article-I.D.: desint.286 Posted: Thu Jan 15 03:01:44 1987 Date-Received: Fri, 16-Jan-87 04:12:41 EST Reply-To: geoff@desint.UUCP (Geoff Kuenning) Distribution: world Organization: Interrupt Technology Corp., Manhattan Beach, CA Lines: 18 >From: stephen@comp.lancs.ac.uk (Stephen J. Muir) >Sometimes, when my spool area is in danger of filling up, I decide to do an >expire run with less than the default number of days. The problem of how many >days worth of news to keep requires a time-consuming examination of the history >file. So here is a wee awk script to print out the number of news articles >received on each date in the history file: I liked the idea, but found the script slow. Here's what I came up with: sed 's/[^\t]*\t\([A-Za-z]* *[0-9]*\).*/\1/' /usr/lib/news/history \ | uniq -c (for posting, I have replaced tabs with "\t". You should turn them back into tabs before trying the script out. -- Geoff Kuenning {hplabs,ihnp4}!trwrb!desint!geoff