Add export data to text file function