|
Hello listers,
Some selected variables from spss datafile will be exported to MS Excel. The resulting excel datafile should be saved to a specified folder using a specified filename. Do you know the syntax? Thank you in advance. John __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
save translate outfile='/folderpath/filename.xls'
/type=xls /replace /*if the file already exists*/ /fieldnames /*if you want variable names in the first row*/ /keep varlist. /*or drop if the list of variables to not include is shorter*/. ________________________________ From: SPSSX(r) Discussion on behalf of John Amora Sent: Thu 4/10/2008 7:46 PM To: [hidden email] Subject: exporting selected variables from spss to Excel Hello listers, Some selected variables from spss datafile will be exported to MS Excel. The resulting excel datafile should be saved to a specified folder using a specified filename. Do you know the syntax? Thank you in advance. John __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com <http://mail.yahoo.com/> ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ====================To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
With reference to your syntax, I ran the modified form
as follows: save translate outfile='C:\Documents and Settins\amoraj\Desktop\BEE\BEE Scored\results\P1T2A.xls' /type=xls /replace /*if the file already exists*/ /fieldnames /*if you want variable names in the first row*/ /keep varlist. /*or drop if the list of variables to not include is shorter*/. It failed: The entire results are as follows: >Error # 9016 in column 24. Text: C:\Documents and Settins\amoraj\Desktop\ >The file specification is invalid, and the output file cannot be opened. >This command not executed. >Error # 5241 in column 9. Text: varlist >Undefined variable name. Check spelling, verify the existence of this >variable. Has it been dropped or renamed in this command? shorter*/. >Error # 1. Command name: shorter >The first word in the line is not recognized as an SPSS command. >This command not executed. Please help. --- "Oliver, Richard" <[hidden email]> wrote: > save translate outfile='/folderpath/filename.xls' > /type=xls > /replace /*if the file already exists*/ > /fieldnames /*if you want variable names in the > first row*/ > /keep varlist. /*or drop if the list of variables > to not include is shorter*/. > > ________________________________ > > From: SPSSX(r) Discussion on behalf of John Amora > Sent: Thu 4/10/2008 7:46 PM > To: [hidden email] > Subject: exporting selected variables from spss to > Excel > > > > Hello listers, > > Some selected variables from spss datafile will be > exported to MS Excel. The resulting excel datafile > should be saved to a specified folder using a > specified filename. Do you know the syntax? > > Thank you in advance. > > John > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com <http://mail.yahoo.com/> > > ===================== > To manage your subscription to SPSSX-L, send a > message to > [hidden email] (not to SPSSX-L), with no > body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send > the command > INFO REFCARD > > ====================To manage your subscription to > SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no > body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send > the command > INFO REFCARD > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
john,
you need to replace VARLIST with the names of the variables that you want to keep. Let's say you want the variables AGE, SEX, and MARTSTAT to be the only variables to be exported in EXCEL then you say -- save translate outfile='C:\Documents and Settins\amoraj\Desktop\BEE\BEE Scored\results\P1T2A.xls' /type=xls /replace /*if the file already exists*/ /fieldnames /*if you want variable names in the first row*/ /keep AGE SEX MARSTAT /*or drop if the list of variables to not include is shorter*/. At 10:24 PM 4/10/2008, John Amora wrote: >With reference to your syntax, I ran the modified form >as follows: > >save translate outfile='C:\Documents and >Settins\amoraj\Desktop\BEE\BEE >Scored\results\P1T2A.xls' > /type=xls > /replace /*if the file already exists*/ > /fieldnames /*if you want variable names in the >first row*/ > /keep varlist. /*or drop if the list of variables to >not include is > shorter*/. > >It failed: The entire results are as follows: > > >Error # 9016 in column 24. Text: C:\Documents and >Settins\amoraj\Desktop\ > >The file specification is invalid, and the output >file cannot be opened. > >This command not executed. > > > >Error # 5241 in column 9. Text: varlist > >Undefined variable name. Check spelling, verify the >existence of this > >variable. Has it been dropped or renamed in this >command? > > shorter*/. > > >Error # 1. Command name: shorter > >The first word in the line is not recognized as an >SPSS command. > >This command not executed. > >Please help. > > > > > > > > > > >--- "Oliver, Richard" <[hidden email]> wrote: > > > save translate outfile='/folderpath/filename.xls' > > /type=xls > > /replace /*if the file already exists*/ > > /fieldnames /*if you want variable names in the > > first row*/ > > /keep varlist. /*or drop if the list of variables > > to not include is shorter*/. > > > > ________________________________ > > > > From: SPSSX(r) Discussion on behalf of John Amora > > Sent: Thu 4/10/2008 7:46 PM > > To: [hidden email] > > Subject: exporting selected variables from spss to > > Excel > > > > > > > > Hello listers, > > > > Some selected variables from spss datafile will be > > exported to MS Excel. The resulting excel datafile > > should be saved to a specified folder using a > > specified filename. Do you know the syntax? > > > > Thank you in advance. > > > > John > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > http://mail.yahoo.com <http://mail.yahoo.com/> > > > > ===================== > > To manage your subscription to SPSSX-L, send a > > message to > > [hidden email] (not to SPSSX-L), with no > > body text except the > > command. To leave the list, send the command > > SIGNOFF SPSSX-L > > For a list of commands to manage subscriptions, send > > the command > > INFO REFCARD > > > > ====================To manage your subscription to > > SPSSX-L, send a message to > > [hidden email] (not to SPSSX-L), with no > > body text except the > > command. To leave the list, send the command > > SIGNOFF SPSSX-L > > For a list of commands to manage subscriptions, send > > the command > > INFO REFCARD > > > > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > >===================== >To manage your subscription to SPSSX-L, send a message to >[hidden email] (not to SPSSX-L), with no body text except the >command. To leave the list, send the command >SIGNOFF SPSSX-L >For a list of commands to manage subscriptions, send the command >INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Johnny Amora
At 10:24 PM 4/10/2008, John Amora wrote:
>With reference to your syntax, I ran the modified form >as follows: > >save translate outfile='C:\Documents and >Settins\amoraj\Desktop\BEE\BEE >Scored\results\P1T2A.xls' > /type=xls > /replace /*if the file already exists*/ > /fieldnames /*if you want variable names in the >first row*/ > /keep varlist. /*or drop if the list of variables to >not include is > shorter*/. At 11:08 PM 4/10/2008, Florio Arguillas wrote, quite rightly: >you need to replace VARLIST with the names of the variables that you >want to keep. Let's say you want the variables AGE, SEX, and >MARTSTAT to be the only variables to be exported in EXCEL then you say -- > >save translate [...] > /keep AGE SEX MARSTAT. In addition, it looks like you're having a problem with your path and file name being too long, and wrapping across lines. SPSS won't recognize this, and gets confused. You can specify breaking up character constants explicitly, though. (Oh, and spell "Settings" right -- not "Settins".) Instead of >save translate outfile='C:\Documents and >Settins\amoraj\Desktop\BEE\BEE >Scored\results\P1T2A.xls' [etc.] use save translate outfile='C:\Documents and Settings' + '\amoraj\Desktop' + '\BEE\BEE Scored\results\' + 'P1T2A.xls' [etc.] ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
