Write to file done

Able to export the data to a file.