Use csv module for generating csv file