pspp-convert: Add -a and -l options to search for a password.
[pspp] / doc / pspp-convert.texi
1 @c PSPP - a program for statistical analysis.
2 @c Copyright (C) 2017 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".
9 @c
10 @node Invoking pspp-convert
11 @chapter Invoking @command{pspp-convert}
12 @cindex Invocation
13 @cindex @command{pspp-convert}
14
15 @command{pspp-convert} is a command-line utility accompanying
16 @pspp{}. It reads an SPSS or SPSS/PC+ system file or SPSS portable
17 file or encrypted SPSS syntax file @var{input} and
18 writes a copy of it to another @var{output} in a different format.
19 Synopsis:
20
21 @display
22 @t{pspp-convert} [@var{options}] @var{input} @var{output}
23
24 @t{pspp-convert -@w{-}help}
25
26 @t{pspp-convert -@w{-}version}
27 @end display
28
29 The format of @var{input} is automatically detected, when possible.
30 The character encoding of old SPSS system files cannot always be
31 guessed correctly, and SPSS/PC+ system files do not include any
32 indication of their encoding.  Use @code{-e @var{encoding}} to specify
33 the encoding in this case.
34
35 By default, the intended format for @var{output} is inferred based on its
36 extension:
37
38 @table @code
39 @item csv
40 @itemx txt
41 Comma-separated value.  Each value is formatted according to its
42 variable's print format.  The first line in the file contains variable
43 names.
44
45 @item sav
46 @item sys
47 SPSS system file.
48
49 @item por
50 SPSS portable file.
51
52 @item sps
53 SPSS syntax file.  (Only encrypted syntax files may be converted to
54 this format.)
55 @end table
56
57 @command{pspp-convert} can convert most input formats to most output
58 formats.  Encrypted system file and syntax files are exceptions: if
59 the input file is in an encrypted format, then the output file must be
60 the same format (decrypted).  To decrypt such a file, specify the
61 encrypted file as @var{input}.  The output will be the equivalent
62 plaintext file.
63
64 The password for encrypted files can be specified a few different
65 ways.  If the password is known, use the @option{-p} option
66 (documented below) or allow @command{pspp-convert} to prompt for it.
67 If the password is unknown, use the @option{-a} and @option{-l}
68 options to specify how to search for it.
69
70 Use @code{-O @var{extension}} to override the inferred format or to
71 specify the format for unrecognized extensions.
72
73 The following options are accepted:
74
75 @table @option
76 @item -O @var{format}
77 @itemx --output-format=@var{format}
78 Specifies the desired output format.  @var{format} must be one of the
79 extensions listed above, e.g. @code{-O csv} requests comma-separated
80 value output.
81
82 @item -c @var{maxcases}
83 @itemx --cases=@var{maxcases}
84 By default, all cases are copied from @var{input} to @var{output}.
85 Specifying this option to limit the number of cases written to
86 @var{output} to @var{maxcases}.
87
88 @item -e @var{charset}
89 @itemx --encoding=@var{charset}
90 Overrides the encoding in which character strings in @var{input} are
91 interpreted.  This option is necessary because old SPSS system files,
92 and SPSS/PC+ system files, do not self-identify their encoding.
93
94 @item -p @var{password}
95 @item --password=@var{password}
96 Specifies the password to use to decrypt an encrypted SPSS system file
97 or syntax file.  If this option is not specified,
98 @command{pspp-convert} will prompt interactively for the password as
99 necessary.
100
101 Be aware that command-line options, including passwords, may be
102 visible to other users on multiuser systems.
103
104 When used with @option{-a} (or @option{--password-alphabet}) and
105 @option{-l} (or @option{--password-length}), this option specifies the
106 starting point for the search.  This can be used to restart a search
107 that was interrupted.
108
109 @item -a @var{alphabet}
110 @item --password-alphabet=@var{alphabet}
111 Specifies the alphabet of symbols over which to search for an
112 encrypted file's password.  @var{alphabet} may include individual
113 characters and ranges delimited by @samp{-}.  For example, @option{-a
114 a-z} searches lowercase letters, @option{-a A-Z0-9} searches uppercase
115 letters and digits, and @option{-a ' -~'} searches all printable ASCII
116 characters.
117
118 @item -l @var{max-length}
119 @item --password-length=@var{max-length}
120 Specifies the maximum length of the passwords to try.
121
122 @item -h
123 @itemx --help
124 Prints a usage message on stdout and exits.
125
126 @item -v
127 @itemx --version
128 Prints version information on stdout and exits.
129 @end table