Monday, August 15, 2011

awk example using pistol pete NBA stats to cmpute point per shot efficiency

http://www.basketballreference.com/players/playerpage.htm?ilkid=MARAVPE02

$ awk '{p=$7;f=$10;t=$13;eff=(p/(f+(t/2)));print $1" "eff}' pistol_NBA
1970-71 1.00777
1971-72 0.983796
1972-73 0.986609
1973-74 1.01542
1974-75 0.943135
1975-76 1.02821
1976-77 0.96847
1977-78 0.971963
1978-79 0.941628
1979-80 0.909091
1979-80 1.08137
1979-80 0.989085

No comments: