Summarised data and write csv