Hi Ben, thanks for the quick reply, this solves a lot of my problems - almost perfect.
To sum it up in case anyone has similar questions: 1. Looking at the right documentation helps a lot ;) (http://pspp.benpfaff.org/~blp/pspp-master/20101104040502/user-manual/index.html) 2. Very clean CSV output can be produced by using the named SET options (SET /ERRORS=OFF /MESSAGES=OFF /PRINTBACK=OFF.), as you suggested. Combined with the errorfile option for pspp invocation this means full info in clean files. 3. The only thing that still disturbs the cleanliness of the csv is the table header (e.g.: "Table: Correlations"). I can live with that, but it would be nice to be able to turn it off. 4. An option to determine text delimiters (e.g.: ",',none) for csv would be a nice addition. 5. It seems you didn't test those SET options entirely - as you suspected. I tested /ERRORS=OFF /MESSAGES=OFF /PRINTBACK=OFF /RESULTS=OFF. They all work fine for csv, but SET /PRINTBACK=OFF is being ignored on html, txt, odt outputs; and they are all are being ignored in the psppire gui's screen output. EXAMPLE: ------------- Syntax: SET ERRORS=OFF /MESSAGES=OFF /PRINTBACK=OFF. GET /FILE="K:\PSPP_Test\PSPP_testfile.sav" CORRELATION /VARIABLES = ALL /PRINT = TWOTAIL SIG. PSPP invocation: pspp "K:\PSPP_Test\Syntax1.sps" -o "K:\PSPP_Test\psppoutput.csv" -O separator=";" -e "K:\PSPP_Test\psppoutput_errors.csv" -------------- thanks again - great project! Björn -----Ursprüngliche Nachricht----- Von: Ben Pfaff [mailto:[email protected]] Gesendet: Freitag, 5. November 2010 04:29 An: Björn Manke Cc: [email protected] Betreff: Re: output as csv from console Björn Manke <[email protected]> writes: > I’d like to output results to a csv file with semi-colons as separators and > possibly some more custiomization. Do you want all PSPP output in CSV format (all tables, for example) or just to write the contents of the PSPP dataset in CSV format? You can do the former by invoking PSPP with "-o <filename>.csv -O separator=';'". It looks like the implementation won't properly handle fields that contain semicolons though (they won't be quoted). You can use SAVE TRANSLATE /TYPE=CSV to do the latter, with /TEXTOPTIONS DELIMITER=';' to set a semicolon as the delimiter. > a) Can this be done and if so, where and how? In the mysterious > “devices” file? In the console command? The "devices" file is no longer used by PSPP 0.7.5. If you have an old copy of one then you can delete it. > b) I can’t find any “devices” file, that is supposedly (according to > documentation) handling the default behavior and seems to be the place for > defining what I want to see in my file. Can I make my own? Any templates? It looks like you are reading old documentation, probably for version 0.6.2. You can read the documentation for 0.7.5 here (among other places): http://pspp.benpfaff.org/~blp/pspp-master/20101104040502/user-manual/index.html > c) From pspp --help I learnt, that there is something like -O OPTION= > VALUE, that looks like it could be helpful. Where can I find documentation > about what OPTIONs and VALUEs exist? The documentation above explains: http://pspp.benpfaff.org/~blp/pspp-master/20101104040502/user-manual/html_node/Invoking-PSPP.html#Invoking-PSPP > d) Is it possible to suppress certain messages so that I get the raw > results, i.e: running a correlation I don’t need any error messages or the > like, just the naked result table values You can turn off certain kinds of output with the SET command, e.g. SET ERRORS=OFF MESSAGES=OFF PRINTBACK=OFF. (I'm not sure that we test this, and the implementation has changed in 0.7.x, so please report problems.) -- Ben Pfaff http://benpfaff.org _______________________________________________ Pspp-users mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-users
