开发者

Access SPSS data from a Python, Java (groovy/grails)' or C++ app without license for SPSS?

I am finding mixed results googling. I have a need to parse a SPSS .sav file to discover the data layout and extract the survey results. Step one is to read the "schema" of the data. For example I need to know the question and its type of allowed responses. I plan to model this data in my own SQL table so I can slice and dice it per my apps requirements. Step two is populate my data model with the respondents answers. Looking at the SPSS sav file I believe it has both types of data I am looking for.

I don't need or want the expensive SPSS software if I don't strictly require it. We will not be doing statistics on this data, just selecting subsets of respondents based on answer filters. The SPSS file will be provided by a partner company that licenses SP开发者_Go百科SS. I do not need to out any data back into SPSS; my use case is read-only.

I can use Python, Java with or without Groovy, C/C++ for my parser program. This program will be run once at the end of data collection so performance is not particularly important. Ideally I'd like my code to be cross platform so I can develop on my Mac and deploy to Linux, but I can use windows if I must,

A lot of what am finding is either java classes from 2004 or modern Python code that requires a DLL from IBM and is windows specific. Based on my quick explanation of requirements, I would appreciate recommendations from the SO community. I think my needs are simple, but haven't found exactly what I had hoped. An open source lib would be ideal, but I'd even pay for a simple commercial solution at a reasonable price.


You can get the SPSS i/o modules with detailed documentation for free in order to build your own app to read (or write) sav files. The modules are available for all platforms supported by SPSS Statistics.

Go to the SPSS Community site at http://www.ibm.com/developerworks/spssdevcentral and follow the links for SPSS Downloads. You have to register, but that is free.

The SAV file is a binary format with a number of complex structures, so it is better to use the i/o modules. And if new features are added to the SAV file, which has often happened, the i/o modules are updated at the same time, so your code won't go out of date.

HTH, Jon Peck


GNU PSPP can apparently read SPSS data files. I also found a link to a description of the format in the PSPP source, although it comes with a warning "don't try to read/write this format directly."


There is a java library here:

http://sourceforge.net/projects/spss-writer/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜