I want to convert the contents of *.sav file into a *.csv file in Python. I have written the following lines of code to access the details of variables in *.sav file. Now, I
I am working on it and, for the moment, this is my 'poor' solution:
First I import module savReaderWriter to convert .sav file into structured array Second I import module numpy to convert structured array into csv:
import savReaderWriter
import numpy as np
reader_np = savReaderWriter.SavReaderNp("infile.sav")
array = reader_np.to_structured_array("outfile.dat")
np.savetxt("outfile2.csv", array, delimiter=",")
reader_np.close()
The problem is that I lose name atributes during conversion. I will try to solve the problem.