more work on datasets
[pspp] / doc / pspp-convert.texi
1 @node Invoking pspp-convert
2 @chapter Invoking @command{pspp-convert}
3 @cindex Invocation
4 @cindex @command{pspp-convert}
5
6 @command{pspp-convert} is a command-line utility accompanying
7 @pspp{}. It reads an SPSS or SPSS/PC+ system file or SPSS portable
8 file or encrypted SPSS syntax file @var{input} and
9 writes a copy of it to another @var{output} in a different format.
10 Synopsis:
11
12 @display
13 @t{pspp-convert} [@var{options}] @var{input} @var{output}
14
15 @t{pspp-convert -@w{-}help}
16
17 @t{pspp-convert -@w{-}version}
18 @end display
19
20 The format of @var{input} is automatically detected, when possible.
21 The character encoding of old SPSS system files cannot always be
22 guessed correctly, and SPSS/PC+ system files do not include any
23 indication of their encoding.  Use @code{-e @var{encoding}} to specify
24 the encoding in this case.
25
26 By default, the intended format for @var{output} is inferred based on its
27 extension:
28
29 @table @code
30 @item csv
31 @itemx txt
32 Comma-separated value.  Each value is formatted according to its
33 variable's print format.  The first line in the file contains variable
34 names.
35
36 @item sav
37 @item sys
38 SPSS system file.
39
40 @item por
41 SPSS portable file.
42
43 @item sps
44 SPSS syntax file.  (Only encrypted syntax files may be converted to
45 this format.)
46 @end table
47
48 @command{pspp-convert} can convert most input formats to most output
49 formats.  Encrypted system file and syntax files are exceptions: if
50 the input file is in an encrypted format, then the output file must be
51 the same format (decrypted).  To decrypt such a file, specify the
52 encrypted file as @var{input}.  The output will be the equivalent
53 plaintext file.  You will be prompted for the password (or use
54 @option{-p}, documented below).
55
56 Use @code{-O @var{extension}} to override the inferred format or to
57 specify the format for unrecognized extensions.
58
59 The following options are accepted:
60
61 @table @option
62 @item -O @var{format}
63 @itemx --output-format=@var{format}
64 Specifies the desired output format.  @var{format} must be one of the
65 extensions listed above, e.g. @code{-O csv} requests comma-separated
66 value output.
67
68 @item -c @var{maxcases}
69 @itemx --cases=@var{maxcases}
70 By default, all cases are copied from @var{input} to @var{output}.
71 Specifying this option to limit the number of cases written to
72 @var{output} to @var{maxcases}.
73
74 @item -e @var{charset}
75 @itemx --encoding=@var{charset}
76 Overrides the encoding in which character strings in @var{input} are
77 interpreted.  This option is necessary because old SPSS system files,
78 and SPSS/PC+ system files, do not self-identify their encoding.
79
80 @item -p @var{password}
81 @item --password=@var{password}
82 Specifies the password to use to decrypt an encrypted SPSS system file
83 or syntax file.  If this option is not specified,
84 @command{pspp-convert} will prompt interactively for the password as
85 necessary.
86
87 Be aware that command-line options, including passwords, may be
88 visible to other users on multiuser systems.
89
90 @item -h
91 @itemx --help
92 Prints a usage message on stdout and exits.
93
94 @item -v
95 @itemx --version
96 Prints version information on stdout and exits.
97 @end table