部員名簿から学科毎の人数をカウント

node.jsとCoffeeScriptの無駄遣い

node.jsとCoffeeScriptの無駄遣い

fs= require("fs")

fs.readFile("2011late.csv", "utf-8", (err, data) ->
		map = {}
		
		if err
			throw err
		
		for item in data.split("\n")
			[gakka, gakunen, namae] = item.split(",")
			if map[gakka] is undefined
					map[gakka] = 1
			else
					map[gakka]++;
					
		console.log(map)
)