utitilites/pspp-output.c: Deal properly with plural forms
[pspp] / utilities / pspp-convert.1
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH pspp\-convert 1 "October 2013" "PSPP" "PSPP Manual"
8 .
9 .SH NAME
10 pspp\-convert \- convert SPSS data files to other formats
11 .
12 .SH SYNOPSIS
13 \fBpspp\-convert\fR [\fIoptions\fR] \fIinput\fR \fIoutput\fR
14 .br
15 \fBpspp\-convert \-\-help\fR | \fB\-h\fR
16 .br
17 \fBpspp\-convert \-\-version\fR | \fB\-v\fR
18 .
19 .SH DESCRIPTION
20 The \fBpspp\-convert\fR program reads \fIinput\fR, which may be an
21 SPSS system file, an SPSS/PC+ system file, an SPSS portable file,
22 or an encrypted SPSS syntax file,
23 and writes it to \fIoutput\fR, performing format conversion as
24 necessary.
25 .PP
26 The format of \fIinput\fR is automatically detected, when possible.
27 The character encoding of old SPSS system files cannot always be
28 guessed correctly, and SPSS/PC+ system files do not include any
29 indication of their encoding.  Use \fB\-e \fIencoding\fR to specify
30 the encoding in this case.
31 .PP
32 By default, the intended format for \fIoutput\fR is inferred from its
33 extension:
34 .
35 .IP \fBcsv\fR
36 .IQ \fBtxt\fR
37 Comma-separated value.  Each value is formatted according to its
38 variable's print format.  The first line in the file contains variable
39 names.
40 .
41 .IP \fBsav\fR
42 .IQ \fBsys\fR
43 SPSS system file.
44 .
45 .IP \fBpor\fR
46 SPSS portable file.
47 .
48 .IP \fBsps\fR
49 SPSS syntax file.  (Only encrypted syntax files may be converted to
50 this format.)
51 .
52 .PP
53 Use \fB\-O \fIextension\fR to override the inferred format or to
54 specify the format for unrecognized extensions.
55 .
56 .PP
57 \fBpspp\-convert\fR can convert most input formats to most output
58 formats.  Encrypted SPSS file formats are exceptions: if the input
59 file is in an encrypted format, then the output file will be the same
60 format (decrypted).  Options for the output format are ignored in this
61 case.
62 .
63 .SH "OPTIONS"
64 .SS "General Options"
65 .
66 .IP "\fB\-O format\fR"
67 .IQ "\fB\-\-output\-format=\fIformat\fR"
68 Specifies the desired output format.  \fIformat\fR must be one of the
69 extensions listed above, e.g. \fB\-O csv\fR requests comma-separated
70 value output.
71 .
72 .IP "\fB\-c \fImaxcases\fR"
73 .IQ "\fB\-\-cases=\fImaxcases\fR"
74 By default, all cases are copied from \fIinput\fR to \fIoutput\fR.
75 Specifying this option to limit the number of cases written to
76 \fIoutput\fR to \fImaxcases\fR.
77 .
78 .IP "\fB\-e \fIcharset\fR"
79 .IQ "\fB\-\-encoding=\fIcharset\fR"
80 Overrides the encoding in which character strings in \fIinput\fR are
81 interpreted.  This option is necessary because old SPSS system files
82 do not self-identify their encoding.
83 .
84 .IP "\fB\-k \fIvar\fR..."
85 .IQ "\fB\-\-keep=\fIvar\fR..."
86 Drops all variables except those listed as \fIvar\fR, and reorders the
87 remaining variables into the specified order.
88 .
89 .IP "\fB\-d \fIvar\fR..."
90 .IQ "\fB\-\-drop=\fIvar\fR..."
91 Drops each \fIvar\fR listed from the output.
92 .
93 .SS "CSV Output Options"
94 .PP
95 These options affect only output to \fB.csv\fR and \fB.txt\fR files.
96 .IP "\fB\-\-labels\fR"
97 By default, \fBpspp\-convert\fR writes variables' values to the output.
98 With this option, \fBpspp\-convert\fR writes value labels.
99 .IP "\fB\-\-no\-var\-names\fR"
100 By default, \fRpspp\-convert\fR\fR writes the variable names as the
101 first line of output.  With this option, \fBpspp\-convert\fR omits
102 this line.
103 .IP "\fB\-\-recode\fR"
104 By default, \fBpspp\-convert\fR writes user-missing values as their
105 regular values.  With this option, \fBpspp\-convert\fR recodes them to
106 system-missing values (which are written as a single space).
107
108 .IP "\fB\-\-print\-formats\fR"
109 By default, \fBpspp\-convert\fR writes numeric variables as plain
110 numbers.  This option makes \fBpspp\-convert\fR honor variables'
111 print formats.
112
113 .IP "\fB\-\-decimal=\fIdecimal\fR"
114 This option sets the character used as a decimal point in output.  The
115 default is a period (\fB.\fR).
116
117 .IP "\fB\-\-delimiter=\fIdelimiter\fR"
118 This option sets the character used to separate fields in output.  The
119 default is a comma (\fB,\fR), unless the decimal point is a comma, in
120 which case a semicolon (\fB;\fR) is used.
121
122 .IP "\fB\-\-qualifier=\fIqualifier\fR"
123 The option sets the character used to quote fields that contain the
124 delimiter.  The default is a double quote (\fB\(dq\fR).
125 .
126 .SS "Password Options"
127 When the input file is encrypted, \fBpspp\-convert\fR needs to obtain
128 a password to decrypt it.  To do so, the user may specify the password
129 with \fB\-p\fR (or \fB\-\-password\fR), or the name of a file containing a
130 list of possible passwords with \fB\-\-password\-list\fR, or an
131 alphabet of possible passwords to try along with a maximum length with
132 \fB\-a\fR (or \fB\-\-password\-alphabet\fR) and \fB\-l\fR (or
133 \-\-password\-length\fR).  If none of these options is used,
134 \fBpspp\-convert\fR prompts for the password.  The password options
135 are:
136 .
137 .IP "\fB\-p \fIpassword\fR"
138 .IQ "\fB\-\-password=\fIpassword\fR"
139 Specifies the password to use to decrypt the input file.
140 .
141 .IP
142 On multiuser systems, this option may not be safe because other users
143 may be able to see the password in process listings.
144 .
145 .IP "\fB\-a \fIalphabet \fB\-l \fImax-length\fR"
146 .IQ "\fB\-\-password-alphabet=\fIalphabet\ \fB\-\-password-length=\fImax-length\fR"
147 These options are an alternative to \fB\-p\fR or \fB\-\-password\fR.
148 They direct \fBpspp\-convert\fR to search for the correct password
149 from the set of all passwords of symbols from \fIalphabet\fR (which
150 may contain character ranges specified with \fB-\fR) and no more than
151 \fImax-length\fR symbols long.  For example, \fB\-a a-z \-l 5\fR
152 checks all possible lowercase alphabetic passwords no more than 5
153 characters long.
154 .IP
155 When these options are used, \fB\-p\fR may additionally specify a
156 starting point for the search.
157 .
158 .IP "\fB\-\-password\-list=\fIfile\fR"
159 Specifies a file to read containing a list of passwords to try, one
160 per line.  If \fIfile\fR is \fB\-\fR, reads from stdin.
161 .
162 .SS "Other Options"
163 .IP "\fB\-h\fR"
164 .IQ "\fB\-\-help\fR"
165 Prints a usage message on stdout and exits.
166 .
167 .IP "\fB\-v\fR"
168 .IQ "\fB\-\-version\fR"
169 Prints version information on stdout and exits.
170 .
171 .SH "AUTHORS"
172 Ben Pfaff.
173 .
174 .SH "SEE ALSO"
175 .
176 .BR pspp\-output (1),
177 .BR pspp (1),
178 .BR psppire (1).