On Fri, 28 Dec 2001 14:52:23 -0600, [log in to unmask] wrote:
>I would like to write a report in Perl (similar to cntpost.rexx) to
>display activity for each of the lists on my server (OpenVMS). However,
>I have a requirement to also display the number of members of a list
>(for the day of the report) as an additional statistic. I have
>reviewed some of the rexx scripts available, but can't find anyway to
>get this number of members count.
>
>Any pointers on how to get that number? Remember, not every list has
>activity over the reporting period so I cannot use the number of
>recepients value.
The following are all Perl one-liners that I use to quickly get information
about lists. They directly parse the *.list file. (You'll have to copy and
paste these onto a single line since email will wrap them)
I hope people find them useful.
Glenn <http://www.netspace.org> <http://lists.netspace.org>
For extracting emails from a single list file
cat $LSROOT/home/mylistfile.list | perl -p -e 's/^.{11}//,
s/\*.{99}|(.{100})/$1\n/g, s/ +$//gm, s/\n+/\n/g, s/^\n//mg'
(for what you want to do, Richard, just add "| wc -l" to the end of the above)
For extracting emails from all list files (prints blank line between lists)
cat $LSROOT/home/*.list | perl -p -e 's/^.{11}//, s/\*.{99}|(.{100})/$1\n/g,
s/ +$//gm, s/\n+/\n/g'
Unique emails over all lists
cat $LSROOT/home/*.list | perl -p -e 's/^.{11}//, s/\*.{99}|(.{100})/$1\n/g,
s/ +$//gm, s/\n+/\n/g'
| grep '@' | awk '{print $1}' | sort -u
For extracting list headers
cat $LSROOT/home/*.list | perl -p -e s/^.{11}//, s/(\*.{99})|.*/$1\n/g, s/
+$//gm'
For extracting list headers (prints a blank line between lists)
cat $LSROOT/home/*.list | perl -p -e 's/^.{11}//, s/(\*.{99})|.*/$1\n/g, s/
+$//gm'
Standard disclaimer:
From these one-liners, you might get the idea to construct scripts to
directly modify the $LSROOT/home/*.list files. DO NOT. Changing them under
the nose of lsv is not a very bright thing to do. The LISTSERV manual warns
not to do this.
|