Complete saving raw data to csv format