Create a csv file output
Impliment the sort for the table