Add support for reading and writing SPV files.
[pspp] / utilities / pspp-output.1
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH pspp\-output 1 "December 2019" "PSPP" "PSPP Manual"
8 .
9 .SH NAME
10 pspp\-output \- convert and operate on SPSS viewer (SPV) files
11 .
12 .SH SYNOPSIS
13 \fBpspp\-output detect \fIfile\fR
14 .br
15 \fBpspp\-output \fR[\fIoptions\fR] \fBdir\fR \fIfile\fR
16 .br
17 \fBpspp\-output \fR[\fIoptions\fR] \fBconvert\fR \fIsource destination\fR
18 .br
19 \fBpspp\-output \-\-help\fR | \fB\-h\fR
20 .br
21 \fBpspp\-output \-\-version\fR | \fB\-v\fR
22 .
23 .SH DESCRIPTION
24 .PP
25 \fBpspp\-output\fR is a command-line utility accompanying PSPP.
26 It supports multiple operations on SPSS viewer or \fB.spv\fR files,
27 here called SPV files.  SPSS 16 and later writes SPV files to
28 represent the contents of its output editor.
29 .PP
30 SPSS 15 and earlier versions instead use \fB.spo\fR files.
31 \fBpspp\-output\fR does not support this format.
32 .PP
33 \fBpspp\-output\fR has a number of subcommands, documented separately
34 below.  \fBpspp\-output\fR also has several undocumented command forms
35 that developers may find useful for debugging.
36 .
37 .SS The \fBdetect\fR command
38 When invoked as \fBpspp\-output detect \fIfile\fR, \fBpspp\-output\fR
39 reads enough of \fIfile\fR to determine whether it is an SPV file.  If
40 so, it exits successfully without outputting anything.  When
41 \fIfile\fR is not an SPV file or if some other error occurs,
42 \fBpspp\-output\fR prints an error message and exits with a failure
43 indication.
44 .
45 .SS The \fBdir\fR command
46 When invoked as \fBpspp\-output dir \fIfile\fR, \fBpspp\-output\fR
47 prints on stdout a table of contents for SPV file \fIfile\fR.  By
48 default, this table lists every object in the file, except for hidden
49 objects.  See the \fBInput Selection Options\fR section below for
50 information on the options available to select a subset of objects.
51 .PP
52 The following additional option for \fBdir\fR is intended mainly for
53 use by PSPP developers:
54 .
55 .IP "\fB\-\-member\-names\fR"
56 Also show the names of the Zip members associated with each object.
57 .
58 .SS The \fBconvert\fR command
59 When invoked as \fBpspp\-output convert \fIsource destination\fR,
60 \fBpspp\-output\fR reads the SPV file \fIsource\fR and converts it
61 to another format, writing the output to \fIdestination\fR.
62 .PP
63 By default, \fBpspp\-output\fR infers the intended format for
64 \fIdestination\fR from its extension:
65 .
66 .IP \fBcsv\fR
67 .IQ \fBtxt\fR
68 Comma-separated value.  Each value is formatted according to its
69 variable's print format.  The first line in the file contains variable
70 names.
71 .
72 .IP \fBsav\fR
73 .IQ \fBsys\fR
74 SPSS system file.
75 .
76 .IP \fBpor\fR
77 SPSS portable file.
78 .
79 .IP \fBsps\fR
80 SPSS syntax file.  (Only encrypted syntax files may be converted to
81 this format.)
82 .PP
83 See the \fBInput Selection Options\fR section below for information on
84 the options available to select a subset of objects to include in the
85 output.  The following additional options are accepted:
86 .IP "\fB-O format=\fIformat\fR"
87 Overrides the format inferred from the output file's extension.
88 \fIformat\fR must be one of the extensions listed above.
89 .IP "\fB-O \fIoption\fB=\fIvalue\fR"
90 Sets an option for the output file format.  Refer to the PSPP manual
91 for details of the available output options.
92 .IP \fB\-F\fR
93 .IQ \fB\-\-force\fR
94 By default, if the source is corrupt or otherwise cannot be processed,
95 the destination is not written.  These option make \fBpspp\-output\fR
96 write the output as best it can, even with errors.
97 .SS "Input Selection Options"
98 The \fBdir\fR and \fBconvert\fR commands, by default, operate on all
99 of the objects in the source SPV file, except for objects that are not
100 visible in the output viewer window.  The user may specify these
101 options to select a subset of the input objects.  When multiple
102 options are used, only objects that satisfy all of them are selected:
103 .IP "\fB\-\-select=\fR[\fB^\fR]\fIclass\fR..."
104 Include only objects of the given \fIclass\fR; with leading \fB^\fR,
105 include only objects not in the class.  Use commas to separate
106 multiple classes.  The supported classes are:
107 .RS
108 .IP
109 \fBcharts headings logs models tables texts trees warnings
110 outlineheaders pagetitle notes unknown other\fR
111 .RE
112 .IP
113 Use \fB\-\-select=help\fR to print this list of classes.
114 .IP "\-\-commands=\fR[\fB^\fR]\fIcommand\fR..."
115 .IQ "\-\-subtypes=\fR[\fB^\fR]\fIsubtype\fR..."
116 .IQ "\-\-labels=\fR[\fB^\fR]\fIlabel\fR..."
117 Include only objects with the specified \fIcommand\fR, \fIsubtype\fR,
118 or \fIlabel\fR.  With a leading \fB^\fR, include only the objects
119 that do not match.  Multiple values may be specified separated by
120 commas.  An asterisk at the end of a value acts as a wildcard.
121 .IP
122 The \fB\-\-command\fR option matches command identifiers, case
123 insensitively.  All of the objects produced by a single command use
124 the same, unique command identifier.  Command identifiers are always
125 in English regardless of the language used for output.  They often
126 differ from the command name in PSPP syntax.  Use the
127 \fBpspp\-output\fR program's \fBdir\fR command to print command
128 identifiers in particular output.
129 .IP
130 The \fB\-\-subtypes\fR option matches particular tables within a
131 command, case insensitively.  Subtypes are not necessarily unique: two
132 commands that produce similar output tables may use the same subtype.
133 Subtypes are always in English and \fBdir\fR will print them.
134 .IP
135 The \fB\-\-labels\fR option matches the labels in table output (that
136 is, the table titles).  Labels are affected by the output language,
137 variable names and labels, split file settings, and other factors.
138 .IP "\fB\-\-instances=\fIinstance\fR..."
139 Include the specified \fIinstance\fR of an object that matches the
140 other criteria within a single command.  The \fIinstance\fR may be a
141 number (1 for the first instance, 2 for the second, and so on) or
142 \fBlast\fR for the last instance.
143 .IP "\fB\-\-show\-hidden"
144 Include hidden output objects in the output.  By default, they are
145 excluded.
146 .IP "\fB\-\-or\fR"
147 Separates two sets of selection options.  Objects selected by either
148 set of options are included in the output.
149 .PP
150 The following additional input selection options are intended mainly
151 for use by PSPP developers:
152 .IP "\fB\-\-errors\fR"
153 Include only objects that cause an error when read.  With the
154 \fBconvert\fR command, this is most useful in conjunction with the
155 \fB\-\-force\fR option.
156 .IP "\fB\-\-members=\fImember\fR..."
157 Include only the objects that include a listed Zip file \fImember\fR.
158 More than one name may be included, comma-separated.  The members in
159 an SPV file may be listed with the \fBdir\fR command by adding the
160 \fB\-\-show\-members\fR option or with the \fBzipinfo\fR program
161 included with many operating systems.  Error messages that
162 \fBpspp\-output\fR prints when it reads SPV files also often include
163 member names.
164 .IP "\fB\-\-member\-names\fR"
165 Displays the name of the Zip member or members associated with each
166 object just above the object itself.
167 .SH "OPTIONS"
168 .IP "\fB\-h\fR"
169 .IQ "\fB\-\-help\fR"
170 Prints a usage message on stdout and exits.
171 .
172 .IP "\fB\-v\fR"
173 .IQ "\fB\-\-version\fR"
174 Prints version information on stdout and exits.
175 .
176 .SH "AUTHORS"
177 Ben Pfaff.
178 .
179 .SH "SEE ALSO"
180 .
181 .BR pspp\-convert (1),
182 .BR pspp (1),
183 .BR psppire (1).