X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=groupstats.pl;h=499e333c463392b365388475ee312fbe55c19c26;hp=8b93559c09ce1fe7fb253e00ae47122ea44cb807;hb=07c0b2589af779c33d5d35b6a7fa0e7883201674;hpb=c30822b48b896836735cee5144cbfa3c3703001d diff --git a/groupstats.pl b/groupstats.pl index 8b93559..499e333 100755 --- a/groupstats.pl +++ b/groupstats.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl -W +#! /usr/bin/perl # # groupstats.pl # @@ -7,7 +7,7 @@ # # It is part of the NewsStats package. # -# Copyright (c) 2010-2012 Thomas Hochstein +# Copyright (c) 2010-2013 Thomas Hochstein # # It can be redistributed and/or modified under the same terms under # which Perl itself is published. @@ -18,6 +18,7 @@ BEGIN { push(@INC, dirname($0)); } use strict; +use warnings; use NewsStats qw(:DEFAULT :TimePeriods :Output :SQLHelper ReadGroupList); @@ -159,9 +160,10 @@ if ($OptReportType and $OptReportType ne 'default') { ### get length of longest newsgroup name delivered by query ### for formatting purposes my $Field = ($GroupBy eq 'month') ? 'newsgroup' : 'month'; -my $MaxLength = &GetMaxLength($DBHandle,$Conf{'DBTableGrps'}, - $Field,$SQLWhereClause,$SQLHavingClause, - @SQLBindNewsgroups); +my ($MaxLength,$MaxValLength) = &GetMaxLength($DBHandle,$Conf{'DBTableGrps'}, + $Field,'postings',$SQLWhereClause, + $SQLHavingClause, + @SQLBindNewsgroups); ### build and execute SQL query my ($DBQuery); @@ -246,7 +248,7 @@ if ($OptCaptions && $OptComments) { # output data &OutputData($OptFormat,$OptComments,$GroupBy,$Precision, $OptCheckgroupsFile ? $ValidGroups : '', - $OptFileTemplate,$DBQuery,$MaxLength); + $OptFileTemplate,$DBQuery,$MaxLength,$MaxValLength); ### close handles $DBHandle->disconnect; @@ -377,6 +379,9 @@ Restrict output to those newgroups present in a file in checkgroups format (one newgroup name per line; everything after the first whitespace on each line is ignored). All other newsgroups will be removed from output. +Contrary to B, I is not a template, but refers to +a single file in checkgroups format. + =item B<-r>, B<--report> I Choose the report type: I, I or I @@ -434,8 +439,8 @@ you'll get the following result: de.comp.datenbanken.misc has not been considered even though it has 38 postings in total, because it has less than 25 postings in every single -month. If you want to list all newsgroups with more than 25 postings U, you'll have to set the boundary type to I, see below. +month. If you want to list all newsgroups with more than 25 postings +I, you'll have to set the boundary type to I, see below. A boundary type of I will show only those newsgroups - at all - that satisfy the boundaries in each and every single month. With the above @@ -447,10 +452,10 @@ you'll get this result: de.comp.datenbanken.ms-access 293 de.comp.datenbanken.mysql has not been considered because it had less than -25 postings in 2012-02. +25 postings in 2012-02 (only). You can use that to get a list of newsgroups that have more (or less) then -x postings during the whole reporting period. +x postings in every month during the whole reporting period. A boundary type of I will show only those newsgroups - at all -that satisfy the boundaries on average. With the above list of newsgroups and