When exporting tables into excel files, SPSS adds notes (output created, comments, input, missing value handling, ... ).
How can I stop that (if possible).
Dr. Frank Gaeth
|
Wrap your syntax in OMS..OMSEND to keep only the parts you need and then direct the output directly to the file format you need. You can also route the full output to the viewer at the same time.
|
In reply to this post by drfg2008
Hi Frank
you may possible adapt and use the pythons script below to remove specific output item. The Script below removes for example all the tables named "Group Statistics" Hope this helps, Christian """ Description: ************ Removes Logs, Notes, Text (see below), Title, and Warnings from the viewer. The Items in the output are: SpssClient.OutputItemType.UNKNOWN 0 SpssClient.OutputItemType.CHART 1 SpssClient.OutputItemType.HEAD 2 qSpssClient.OutputItemType.LOG 3 SpssClient.OutputItemType.NOTE 4 SpssClient.OutputItemType.PIVOT 5 SpssClient.OutputItemType.ROOT 6 SpssClient.OutputItemType.TEXT 7 SpssClient.OutputItemType.WARNING 8 SpssClient.OutputItemType.TITLE 9 SpssClient.OutputItemType.PAGETITLE 11 SpssClient.OutputItemType.TREEMODEL 13 SpssClient.OutputItemType.GENERIC 14 """ import SpssClient """ """ SpssClient.StartClient() try: OutputDoc = SpssClient.GetDesignatedOutputDoc() OutputItems = OutputDoc.GetOutputItems() #DesignatedOutputDoc = SpssClient.GetDesignatedOutputDoc() OutputDoc.ClearSelection for index in range(OutputItems.Size()): OutputItem = OutputItems.GetItemAt(index) if OutputItem.GetType() == 5: # Table if OutputItem.GetDescription() == "Group Statistics": OutputItem.SetSelected(True) OutputDoc.Delete() #Delete all the selected item. finally: SpssClient.StopClient() ********************************** la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 CH-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] Web: www.lavolta.ch -----Ursprüngliche Nachricht----- Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von drfg2008 Gesendet: Mittwoch, 12. Dezember 2012 10:51 An: [hidden email] Betreff: how to get rid of Notes in export When exporting tables into excel files, SPSS adds notes (output created, comments, input, missing value handling, ... ). How can I stop that (if possible). ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-get-rid-of-Notes-in-exp ort-tp5716897.html Sent from the SPSSX Discussion mailing list archive at Nabble.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 drfg2008
you can hide all notes/log/warning using option from output pane and export only tables in excel.
Regards, Gaurav
On Wed, Dec 12, 2012 at 3:21 PM, drfg2008 <[hidden email]> wrote: When exporting tables into excel files, SPSS adds notes (output created, |
In reply to this post by drfg2008
you can hide all notes/log/warning using option from output pane and export only tables in excel.
Regards, Gaurav |
Administrator
|
In reply to this post by drfg2008
How are you exporting to Excel? I.e., File > Export when in the output viewer? Or via OMS?
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
In reply to this post by drfg2008
One way is to suppress these items from
the Viewer altogether or making them invisible. OMS and Edit>Options>Viewer
can do this.
Another approach is to use the SPSSINC MODIFY OUTPUT extension command, which is part of the Python Essentials, with one the functions in the customoutputfunctions.py module included with that command. There is a function called excel export that supports all of the choices available in the Export dialog. Using this, you use the regular MODIFY OUTPUT parameters to select the objects and the excelexport parameters to control the export parameters. Here's an example that exports all tables into a file called alltables.xls with sheets named sheet0, sheet1, ... SPSSINC MODIFY OUTPUT TABLES /IF PROCESS=ALL /CUSTOM FUNCTION="customoutputfunctions.excelexport(file='c:/temp/alltables.xls', action='CreateWorksheet', sheet='sheet#')". This version would export only custom tables output into separate files named alltables0.xls, alltables1.xls,... SPSSINC MODIFY OUTPUT TABLES /IF PROCESS=ALL SUBTYPE="customtable" /CUSTOM FUNCTION="customoutputfunctions.excelexport(file='c:/temp/alltables#.xls', action='CreateWorksheet')". The excelexport function was added to MODIFY OUTPUT in April, so if your version of the Python Essentials is older, you would need to download a newer version of SPSSINC MODIFY OUTPUT from the SPSS Community site. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email], Date: 12/12/2012 02:52 AM Subject: [SPSSX-L] how to get rid of Notes in export Sent by: "SPSSX(r) Discussion" <[hidden email]> When exporting tables into excel files, SPSS adds notes (output created, comments, input, missing value handling, ... ). How can I stop that (if possible). ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-get-rid-of-Notes-in-export-tp5716897.html Sent from the SPSSX Discussion mailing list archive at Nabble.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 |
SPSS20 64bit
@Jon I would like to use the "SPSSINC MODIFY OUTPUT TABLES " However, I don't quite understand if I have to download a plugin from the essentials website [1] (where I couldn't find it as a plugin, or if it is already part of the python essentials. I have installed Python essentials, but the following syntax does not work: SPSSINC MODIFY OUTPUT TABLES /IF PROCESS=ALL SUBTYPE="customtable" /CUSTOM FUNCTION="customoutputfunctions.excelexport(file='T:\BI\DEPARTMENTS\Finance\Revenue_Daily.xls')". * Export Output. OUTPUT EXPORT /CONTENTS EXPORT=ALL LAYERS=PRINTSETTING MODELVIEWS=PRINTSETTING /XLS DOCUMENTFILE='T:\BI\DEPARTMENTS\Finance\Revenue_Daily.xls' OPERATION=CREATEFILE LOCATION=LASTCOLUMN NOTESCAPTIONS=YES. Error Message: Warnings Import failure. function: excelexport, module: customoutputfunctions [1] https://www.ibm.com/developerworks/community/files/app?lang=en#/collection/0c39f1d0-c6ba-44f8-bffc-c8f0bb97e1f6
Dr. Frank Gaeth
|
----- Original Message -----
> From: drfg2008 <[hidden email]> > To: [hidden email] > Cc: > Sent: Friday, August 30, 2013 3:22 PM > Subject: Re: [SPSSX-L] how to get rid of Notes in export > > SPSS20 64bit > > @Jon > > I would like to use the "SPSSINC MODIFY OUTPUT TABLES " > > However, I don't quite understand if I have to download a plugin from the > essentials website [1] (where I couldn't find it as a plugin, or if it is > already part of the python essentials. I have installed Python essentials, > but the following syntax does not work: > > > SPSSINC MODIFY OUTPUT TABLES > /IF PROCESS=ALL SUBTYPE="customtable" > /CUSTOM > FUNCTION="customoutputfunctions.excelexport(file='T:\BI\DEPARTMENTS\Finance\Revenue_Daily.xls')". Alternatively: BEGIN PROGRAM PYTHON. import SpssClient SpssClient.StartClient() OutputDoc = SpssClient.GetDesignatedOutputDoc() OutputDoc.SelectAllNotes() OutputDoc.Delete() END PROGRAM. ===================== 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 drfg2008
SPSSINC MODIFY OUTPUT is an extension command
that is included in the Python Essentials in recent versions. It
is not included in V22, because there is a new native command OUTPUT MODIFY,
that has similar functions and a UI that is integrated with various procedure
dialogs. However, it remains available in the Extensions Collection
on the SPSS Community website, so it can be downloaded and installed from
there.
The problem below, however, is that the customoutputfunctions.py module that is included with the command is missing or out of date, so the particular custom function referenced was not found. Try downloading and installing the command again. (In V22 you can do this directly from Utilities > Extension Bundles > Download and Install Extension Bundles.) That the command got far enough to fail in this way indicates that the plugin and the command itself are working correctly. Note: in the file parameter, you should use / instead of \ as the separator in order to avoid the standard Python interpretation of escape sequences such as \n. In this particular case, none of the characters would be misinterpreted, but it could happen with other paths. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email], Date: 08/30/2013 07:23 AM Subject: Re: [SPSSX-L] how to get rid of Notes in export Sent by: "SPSSX(r) Discussion" <[hidden email]> SPSS20 64bit @Jon I would like to use the "SPSSINC MODIFY OUTPUT TABLES " However, I don't quite understand if I have to download a plugin from the essentials website [1] (where I couldn't find it as a plugin, or if it is already part of the python essentials. I have installed Python essentials, but the following syntax does not work: SPSSINC MODIFY OUTPUT TABLES /IF PROCESS=ALL SUBTYPE="customtable" /CUSTOM FUNCTION="customoutputfunctions.excelexport(file='T:\BI\DEPARTMENTS\Finance\Revenue_Daily.xls')". * Export Output. OUTPUT EXPORT /CONTENTS EXPORT=ALL LAYERS=PRINTSETTING MODELVIEWS=PRINTSETTING /XLS DOCUMENTFILE='T:\BI\DEPARTMENTS\Finance\Revenue_Daily.xls' OPERATION=CREATEFILE LOCATION=LASTCOLUMN NOTESCAPTIONS=YES. Error Message: Warnings Import failure. function: excelexport, module: customoutputfunctions [1] https://www.ibm.com/developerworks/community/files/app?lang=en#/collection/0c39f1d0-c6ba-44f8-bffc-c8f0bb97e1f6 ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-get-rid-of-Notes-in-export-tp5716897p5721793.html Sent from the SPSSX Discussion mailing list archive at Nabble.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 |
Free forum by Nabble | Edit this page |