help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] simmerize


From: Val Krem
Subject: [Help-bash] simmerize
Date: Sun, 21 Aug 2016 01:54:00 +0000 (UTC)

Hi all,

I am trying to summarize a huge data set by  ID and year.
Here is the sample of data.

ID  Year
Ak1 2001
Ak1 2001
Ak1 2001
Ak1 2002
Ak1 2007
Ak1 2003
Ak1 2003
Ak1 2004
Ak2 2001

Count the number of years occurrence for each ID  and produce the result as 
follows.

         2001 2002 2003 2004 Total
Ak1        3       2      2       1       8
Ak2   0       0      2       2       4
Ak3        1       0      0    0       1

Please note that, 
ID "Ak2" does not have observation in year 2001 and 2002. 
ID "Ak3" has observation only in year 2001.

Any help ?
Thank you in advance


reply via email to

[Prev in Thread] Current Thread [Next in Thread]