SPSS .sav to short or long format csv file
Installation has so far been tested on Debian (+Raspbian, +Ubuntu 20.04), Redhat (+CentOs 7) and macOS Catalina (10.15.7).
Only requires C Standard Library + maths.h.
# sudo curl -OL https://github.com/erbarratt/sav2csv/archive/refs/heads/main.tar.gz
or
# sudo wget https://github.com/erbarratt/sav2csv/archive/refs/heads/main.tar.gz
Verify installation using the version option:
# ./sav2csv -v
Should output similar to:
sav2csv version 1.9.3 2021-04-02
To call the program in it's current directory, use:
# sudo ./sav2csv [options] [arguments]
sudo is needed for being able to write files correctly.
The help option is exclusive - the help output will only run if -h is the sole option passed. Help lists all available options.
# ./sav2csv -h
The version option is exclusive - the version output will only run if -v is the sole option passed.
# ./sav2csv -v
Use -f to define the input .sav file.
*This option is required
# sudo ./sav2csv -f filename.sav
Use -o to define the prefix for any output csv's. The program will append x.csv, where x is the number of the current csv file being written to, determined by the line limit option. Defaults to "out" (therefor out1.csv, out2.csv...).
# sudo ./sav2csv -f filename.sav -o prefix
Use -w to define the directory for any output csv's. Defaults to "" (current directory).
# sudo ./sav2csv -f filename.sav -w /path/to/your/directory/
Use -l to define how many rows should make up each output csv. Defaults to 1000000 (1 million). If output rows less, then only one file is generated. Program will check to see if this is a valid integer greater than 0.
# sudo ./sav2csv -f filename.sav -l 500000
Use -s to disable all output to stdout.
# sudo ./sav2csv -f filename.sav -s
Use -d to enable Debug mode, which will output all information read by the program from the .sav file. Debug mode will only output if not in silent mode.
# sudo ./sav2csv -f filename.sav -d
Use -F to output csv files as flat table style. Default is long format csv (many to many).
# sudo ./sav2csv -f filename.sav -F
Use -R to output the row index as the first field in each line of the csv.
# sudo ./sav2csv -f filename.sav -R
Set filename, output prefix and line limit, in silent mode, as a flat style csv including row indexes.
# sudo ./sav2csv -f filename.sav -o prefix -l 5000000 -sFR