Generating data to csv file