Thread Tools  
MathLab
Junior Member
 
Join Date: Aug 2008
MathLab is on a distinguished road Posts: 9
Making data files compatible with SPSS, Posted October 31st, 2008 #1
I've just spent the day trying to read SuperLab data output files into SPSS. I used Dataviewer to first merge the output of several participants - that's a great feature! While I can read the resulting merged output file into Excel, save into .xls and then read it into SPSS from the .xls format, this is not preferred since I cannot then control the field sizes and end up with SPSS files that aren't compatible with each other. With a few changes though, the text files can be read in. It would be great to incorporate these changes into the next version of SuperLab.

1. In a text editor, I had to do a global change to remove all the quotation symbols.
SPSS only allows a single text delimiter - in the output files, some text is delimited by quotes, and some isn't.
RECOMMENDATION: SuperLab should not put quotes around any of the text it spits out - the tab delimiters are enough.

2. In a text editor, I did a 'SAVE AS' with the line feeds in UNIX format. SuperLab is generating Mac format line feeds - SPSS can't understand them, so when I try to read in the text file, it generates thousands of variables.
RECOMMENDATION: SuperLab on the mac should generate UNIX line feeds. SPSS and all Mac programs can handle them.
Reply With Quote
Hank
Senior Member
 
Join Date: Aug 2006
Location: Asheville, NC
Hank is on a distinguished road Posts: 490
Posted October 31st, 2008 #2
1. SuperLab does not put quotes around any of the text it spits out. I checked all of my output files from running experiments on my own machine: none of them had double quotation marks, and none of them had single quotation marks that weren't either in a name or that weren't representing an actual key press. If you have extra quotation marks when you're trying to load your file into SPSS, I'm inclined to believe it's not SuperLab doing it.

find . -iregex '.*\.txt$' -print0 | xargs -0 grep '"'
find . -iregex '.*\.txt$' -print0 | xargs -0 grep "'"

2. Unfortunately, I can't easily write a command at my command prompt to verify this. All of the files I opened with TextWrangler were already Unix (LF) format. Again, if you're seeing your files as Mac (CR) format, I'm inclined to believe it's not SuperLab doing this.


Can you attach a few sample text files that represent what SuperLab is doing and what SPSS is instead expecting?
Reply With Quote
MathLab
Junior Member
 
Join Date: Aug 2008
MathLab is on a distinguished road Posts: 9
It's Excel - sorry!, Posted November 3rd, 2008 #3
Hi Hank,
You are right - it seems to be Excel that is adding those quotes and changing the line feeds. I had opened the .txt file in Excel to revise the headers into a single line (since SPSS expects a single line of single word headers, like 'trial_number'), and Excel had added those quote marks. I had then clicked Save and kept it as tab-delimited text. So Excel (I'm using Excel 2008) is the culprit, and I apologize for the confusion.

What I will do is save without headers from now on (found that in SuperLab Options - thank you for that!) and add variable names in SPSS, since SPSS can't cope with the SuperLab headers.
Reply With Quote
Thread Tools
Posting Rules
Forum Jump:
Copyright Cedrus Corporation, 1991-2014.
All times are GMT -7. The time now is 06:45 PM.