Record data to csv