Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion extract different things from server list
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Heinz Müller  
View profile  
 More options Oct 7 2012, 5:24 am
Newsgroups: comp.lang.awk
From: Heinz Müller <onkelhe...@mscologne.de>
Date: Sun, 07 Oct 2012 11:24:14 +0200
Local: Sun, Oct 7 2012 5:24 am
Subject: Re: extract different things from server list
Am 07.10.2012 10:52, schrieb Janis Papanagnou:

> On 07.10.2012 08:51, Heinz M ller wrote:

>>> You're welcome. Note that Janis' solution and mine will report different
>>> values if one manufacturer uses the "single" enclosure type twice
>>> (Janis' will count it as 1, mine will count it as 2). I'm not sure which
>>> is correct but it should be fairly easy to tweak either solution to do
>>> the opposite thing.

>>>        Ed.

>> Aaah,

>> although I did a quick test with a test sample I didn't notice that Janis'
>> version count them as 1. Now I checked that with the real data and yes, there
>> is the difference between yours and Janis' script.

> I'm still not sure whether the small modification below is what you want...

>    awk '
>      BEGIN {FS=";"}
>      NR==1 {next}
>      !serv[$1]++ {s++}
>      !encl[$2]++ || $2=="single" {e++}
>      !manu[$2,$3]++ || $2=="single" { m[$3]++ }
>      END { print s, e
>            for (i in m) print i, m[i]
>      }
>    '

> If not, it would be helpful if you'd provide some of those real data to see.

> Janis

Janis,

yes, now it works as espected. Same results as Ed's version:

num servers = 341
num enclosures types = 183
num enclosure types for manufaturer HP = 84
num enclosure types for manufaturer SUN Microsystem = 92
num enclosure types for manufaturer unklar = 2
num enclosure types for manufaturer FUJITSU = 5

But I didn't want to critisize your last awk script version.
It was my fault because my instructions were not clear enough.

Thanks again!

Heinz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.