Saturday, August 13, 2011

awk to compute steve nash point per shot efficiency by year

stats placed in file called nash
http://basketballreference.com/players/playerpage.htm?ilkid=NASHST01

$ awk '{g=$5;p=$8;f=$10/g;t=$13/g;s=f+t/2;if (s) printf "%6.2f %-8s %2d\n", p/s,
$1, p}' nash
1.07 1996-97 3
1.10 1997-98 9
0.94 1998-99 7
1.19 1999-00 8
1.19 2000-01 15
1.19 2001-02 17
1.13 2002-03 17
1.17 2003-04 14
1.19 2004-05 15
1.24 2005-06 18
1.29 2006-07 18
1.26 2007-08 16
1.22 2008-09 15
1.22 2009-10 16

No comments: