If you can use Python, I just published a library that could help with this. Dumping in CSV will look something like this (untested):
import xport, csv with xport.XportReader('in.xpt') as reader: with open('out.csv', 'rb') as out: writer = csv.DictWriter(out, [f['name'] for f in reader.fields]) for row in reader: writer.writerow(row)
Files are treated as streams, so it doesn't matter how big the file is (unless you call reader.record_count (), which you should look for at the end of the file).
Let me know if you try this - the library works for me, but I have not tried it in many .xpt files yet.
source share