Skip to content

Instantly share code, notes, and snippets.

@snurhussein
Last active October 31, 2021 23:49
Show Gist options
  • Select an option

  • Save snurhussein/008dbe9858b12235f0d5 to your computer and use it in GitHub Desktop.

Select an option

Save snurhussein/008dbe9858b12235f0d5 to your computer and use it in GitHub Desktop.
Using PSPP to convert sav files to csv

#Converting SPSS files to csv with PSPP#

Install and open PSPP Use the File menu to open your file (it probably has a .sav extension) Go to File>New>Syntax to open PSPP's command line window

Enter:

SAVE TRANSLATE
  /OUTFILE="path/newcsvfile.csv"  //location for your new file
  /TYPE=CSV
  /FIELDNAMES       //optional command to insert fieldnames in the top row
  /CELLS=LABELS.     //optional command specifying to export "labels" from the SPSS codebook (e.g. excellent). Change "labels" to "values" for value reponses (e.g. "5" for "excellent")

RUN

@RobotimusPrimed

Copy link
Copy Markdown

Hello
I used your code (TY) to convert the NSSE files from sav to csv, however, now there are multiple problems and I am not sure if I can trust the conversion. Several columns that were numbers came in as custom columns and changed to dates. Other columns came in with a number, with the value label, and both, and some, the digit in sav file was converted to a word in the csv such as 1, one. Any suggestions?
Thank you.

@xlxs4

xlxs4 commented May 11, 2021

Copy link
Copy Markdown

Sorry to jump in on this, but you can follow something like this, and export to .csv from within Excel (and I would guess OpenOffice, etc.)

@snurhussein

Copy link
Copy Markdown
Author

Thanks @xlxs4 and sorry @RobotimusPrimed. I really have no idea what could be causing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment