1 @c PSPP - a program for statistical analysis.
2 @c Copyright (C) 2019, 2020 Free Software Foundation, Inc.
3 @c Permission is granted to copy, distribute and/or modify this document
4 @c under the terms of the GNU Free Documentation License, Version 1.3
5 @c or any later version published by the Free Software Foundation;
6 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
7 @c A copy of the license is included in the section entitled "GNU
8 @c Free Documentation License".
10 @node Invoking pspp-output
11 @chapter Invoking @command{pspp-output}
13 @cindex @command{pspp-output}
15 @command{pspp-output} is a command-line utility accompanying @pspp{}.
16 It supports multiple operations on SPSS viewer or @file{.spv} files,
17 here called SPV files. SPSS 16 and later writes SPV files to
18 represent the contents of its output editor.
20 SPSS 15 and earlier versions instead use @file{.spo} files.
21 @command{pspp-output} does not support this format.
23 @command{pspp-options} may be invoked in the following ways:
26 @t{pspp-output} @t{detect} @var{file}
28 @t{pspp-output} [@var{options}] @t{dir} @var{file}
30 @t{pspp-output} [@var{options}] @t{convert} @var{source} @var{destination}
32 @t{pspp-output} [@var{options}] @t{get-table-look} @var{source} @var{destination}
34 @t{pspp-output} [@var{options}] @t{convert-table-look} @var{source} @var{destination}
36 @t{pspp-output -@w{-}help}
38 @t{pspp-output -@w{-}version}
41 Each of these forms is documented separately below.
42 @command{pspp-output} also has several undocumented command forms that
43 developers may find useful for debugging.
46 * The pspp-output detect Command::
47 * The pspp-output dir Command::
48 * The pspp-output convert Command::
49 * The pspp-output modify Command::
50 * The pspp-output get-table-look Command::
51 * The pspp-output convert-table-look Command::
52 * Input Selection Options::
55 @node The pspp-output detect Command
56 @section The @code{detect} Command
59 @t{pspp-output} @t{detect} @var{file}
62 When @var{file} is an SPV file, @command{pspp-output} exits
63 successfully without outputting anything. When @var{file} is not an
64 SPV file or some other error occurs, @command{pspp-output} prints an
65 error message and exits with a failure indication.
67 @node The pspp-output dir Command
68 @section The @code{dir} Command
71 @t{pspp-output} [@var{options}] @t{dir} @var{file}
74 Prints on stdout a table of contents for SPV file @var{file}. By
75 default, this table lists every object in the file, except for hidden
76 objects. @xref{Input Selection Options}, for information on the
77 options available to select a subset of objects.
79 The following additional option for @command{dir} is intended mainly
80 for use by PSPP developers:
84 Also show the names of the Zip members associated with each object.
87 @node The pspp-output convert Command
88 @section The @code{convert} Command
91 @t{pspp-output} [@var{options}] @t{convert} @var{source} @var{destination}
94 Reads SPV file @var{source} and converts it to another format, writing
95 the output to @var{destination}.
97 By default, the intended format for @var{destination} is inferred
98 based on its extension, in the same way that the @command{pspp}
99 program does for its output files. @xref{Invoking PSPP}, for details.
101 @xref{Input Selection Options}, for information on the options
102 available to select a subset of objects to include in the output. The
103 following additional options are accepted:
106 @item -O format=@var{format}
107 Overrides the format inferred from the output file's extension. Use
108 @option{--help} to list the available formats. @xref{Invoking PSPP},
109 for details of the available output formats.
111 @item -O @var{option}=@var{value}
112 Sets an option for the output file format. @xref{Invoking PSPP}, for
113 details of the available output options.
117 By default, if the source is corrupt or otherwise cannot be processed,
118 the destination is not written. With @option{-F} or @option{--force},
119 the destination is written as best it can, even with errors.
121 @item --table-look=@var{file}
122 Reads a table style from @var{file} and applies it to all of the
123 output tables. The file should be a TableLook @file{.stt} or
127 @node The pspp-output modify Command
128 @section The @code{modify} Command
131 @t{pspp-output} [@var{options}] @t{modify} @var{file} [@var{new-file}]
134 Reads SPV @var{file} and writes out a modified version. Without
135 @var{new-file}, the modified file replaces @var{file} in-place. With
136 @var{new-file}, @code{pspp-output} writes the modified version as
137 @var{new-file}. In the latter case, @code{pspp-output} by default
138 infers the format of @var{new-file} the intended format for
139 @var{destination} is inferred based on its extension, in the same way
140 that the @command{pspp} program does for its output files.
141 @xref{Invoking PSPP}, for details.
143 The @code{modify} command includes all objects in @var{file} in its
144 output, @strong{except} that it deletes objects in formats not yet
145 understood by PSPP, such as charts. @xref{Input Selection Options},
146 for information on the options available to select a subset of objects
147 to modify while copying them to the output.
149 The following options specify modifications to be made:
152 @item --set-visible=@var{bool}
153 Makes the selected visible or invisible, according to @var{bool}.
155 @item --set-label=@var{label}
156 Set the selected objects' labels to @var{label}. Labels appear in the
157 outline in the PSPPIRE output viewer window and in the outline sidebar
158 in PDF output. The @var{label} may contain any of the following
159 substitution variables:
166 The current date in format @code{DD-MMM-YYYY}, @code{MM/DD/YYYY},
167 @code{YYYY/MM/DD}, or @code{DD.MM.YYYY}, respectively.
171 The current time in the format @code{hh:mm:ss}, using a 12-hour or
172 24-hour clock, respectively.
175 The number of objects modified so far: 1 for the first object, 2 for
176 the second, and so on.
179 The existing label text.
182 For example, to add an index at the beginning of each object's label,
183 use @option{--set-label=')INDEX. )LABEL'}.
185 @item --set-title=@var{title}
186 Sets the titles of selected table objects to @var{title}, which
187 supports the same substitution variables as @option{--set-label}.
190 Transposes rows and columns of selected table objects.
192 @item --table-look=@var{file}
193 Reads a table style from @var{file} and applies it to selected table
194 objects. The file should be a TableLook @file{.stt} or @file{.tlo}
197 @item --set-comment=@var{comment}
198 Sets the comment on the selected table objects to @var{comment}.
199 Comment text appears as a tooltip when the user hovers over the table
200 in the PSPPIRE output viewer window or in exported HTML.
201 @var{comment} supports the same substitution variables as
202 @option{--set-label}, plus
208 @item -O format=@var{format}
209 Overrides the format inferred from the output file's extension. Use
210 @option{--help} to list the available formats. @xref{Invoking PSPP},
211 for details of the available output formats.
213 @item -O @var{option}=@var{value}
214 Sets an option for the output file format. @xref{Invoking PSPP}, for
215 details of the available output options.
219 By default, if the source is corrupt or otherwise cannot be processed,
220 the destination is not written. With @option{-F} or @option{--force},
221 the destination is written as best it can, even with errors.
224 @node The pspp-output get-table-look Command
225 @section The @code{get-table-look} Command
228 @t{pspp-output} [@var{options}] @t{get-table-look} @var{source} @var{destination}
231 Reads SPV file @var{source}, applies any selection options
232 (@pxref{Input Selection Options}), picks the first table from the
233 selected object, extracts the TableLook from that table, and writes it
234 to @var{destination} (typically with an @file{.stt} extension) in the
235 TableLook XML format.
237 The user may use the TableLook file to change the style of tables in
238 other files, by passing it to the @option{--table-look} option on the
239 @code{convert} command.
241 @node The pspp-output convert-table-look Command
242 @section The @code{convert-table-look} Command
245 @t{pspp-output} [@var{options}] @t{convert-table-look} @var{source} @var{destination}
248 Reads @file{.stt} or @file{.tlo} file @var{source}, and writes it back
249 to @var{destination} (typically with an @file{.stt} extension) in the
250 TableLook XML format. This is useful for converting a TableLook
251 @file{.tlo} file from SPSS 15 or earlier into the newer @file{.stt}
254 @node Input Selection Options
255 @section Input Selection Options
257 The @command{dir} and @command{convert} commands, by default, operate
258 on all of the objects in the source SPV file, except for objects that
259 are not visible in the output viewer window. The user may specify
260 these options to select a subset of the input objects. When multiple
261 options are used, only objects that satisfy all of them are selected:
264 @item --select=@r{[}^@r{]}@var{class}@dots{}
265 Include only objects of the given @var{class}; with leading @samp{^},
266 include only objects not in the class. Use commas to separate
267 multiple classes. The supported classes are:
270 @code{charts headings logs models tables texts trees warnings
271 outlineheaders pagetitle notes unknown other}
274 Use @option{--select=help} to print this list of classes.
276 @item --commands=@r{[}^@r{]}@var{command}@dots{}
277 @itemx --subtypes=@r{[}^@r{]}@var{subtype}@dots{}
278 @itemx --labels=@r{[}^@r{]}@var{label}@dots{}
279 Include only objects with the specified @var{command}, @var{subtype},
280 or @var{label}. With a leading @samp{^}, include only the objects
281 that do not match. Multiple values may be specified separated by
282 commas. An asterisk at the end of a value acts as a wildcard.
284 The @option{--command} option matches command identifiers, case
285 insensitively. All of the objects produced by a single command use
286 the same, unique command identifier. Command identifiers are always
287 in English regardless of the language used for output. They often
288 differ from the command name in PSPP syntax. Use the
289 @command{pspp-output} program's @command{dir} command to print command
290 identifiers in particular output.
292 The @option{--subtypes} option matches particular tables within a
293 command, case insensitively. Subtypes are not necessarily unique: two
294 commands that produce similar output tables may use the same subtype.
295 Subtypes are always in English and @command{dir} will print them.
297 The @option{--labels} option matches the labels in table output (that
298 is, the table titles). Labels are affected by the output language,
299 variable names and labels, split file settings, and other factors.
301 @item --nth-commands=@var{n}@dots{}
302 Include only objects from the @var{n}th command that matches
303 @option{--command} (or the @var{n}th command overall if
304 @option{--command} is not specified), where @var{n} is 1 for the first
305 command, 2 for the second, and so on.
307 @item --instances=@var{instance}@dots{}
308 Include the specified @var{instance} of an object that matches the
309 other criteria within a single command. The @var{instance} may be a
310 number (1 for the first instance, 2 for the second, and so on) or
311 @code{last} for the last instance.
314 Include hidden output objects in the output. By default, they are
318 Separates two sets of selection options. Objects selected by either
319 set of options are included in the output.
322 The following additional input selection options are intended mainly
323 for use by PSPP developers:
327 Include only objects that cause an error when read. With the
328 @command{convert} command, this is most useful in conjunction with the
329 @option{--force} option.
331 @item --members=@var{member}@dots{}
332 Include only the objects that include a listed Zip file @var{member}.
333 More than one name may be included, comma-separated. The members in
334 an SPV file may be listed with the @command{dir} command by adding the
335 @option{--show-members} option or with the @command{zipinfo} program
336 included with many operating systems. Error messages that
337 @command{pspp-output} prints when it reads SPV files also often
338 include member names.
341 Displays the name of the Zip member or members associated with each
342 object just above the object itself.