write stats to a csv file