sorting and limiting a sub-top-n

Joost Bekkers joost at bps.jodocus.org
Wed Jul 11 09:28:11 CEST 2001


On Wed, Jul 11, 2001 at 12:57:47AM +0200, Joost van Baal wrote:
> Hi Joost,
> 
> On Tue, Jul 10, 2001 at 12:06:29PM +0200, Joost Bekkers wrote:
> > 

<snip>

> 
> This works with GNU sort, as well as with the sort shipped with OpenBSD.
> 
> I believe this is about what you want.  If not, please let us know.
> (How did you get your initial table?)
> 
    cut -d' ' -f $DLF_CLIENT,$DLF_SIZE,$DLF_HOST | \
    while read c s h; do echo $c $h $s; done | sort -n | dlf_sum | \
    cut -d' ' -f 1,2,3 | dlf_total 0 | \
    while read d r s t; do echo $t $d $s $r; done | \
    lr_querycalc2xml

Yes this looks a lot like something from the www superservice.

> To limit a sub top-n I guess I would use perl or awk.  Dunno of any
> simpler trick.  (You might want to do the whole thing, including the
> sort stuff, in perl, btw.)

:-(

-- 
greetz Joost
joost at jodocus.org

-- 
To UNSUBSCRIBE, email to questions-request at logreport.org with a subject of 
"unsubscribe". Trouble? Send an email with subject "help" to 
questions-request at logreport.org



More information about the Questions mailing list