write the data to a csv file