Write to csv and html