convert mid outputs to .csv file