Write out csv