output result to csv