Convert tables into csv files