READSTAT(1)
β¨ READSTAT(1) β the readstat glow-up β¨
okay bestie, gather round, because this is the manual page for readstat, from the General Commands Manual section of the Unix world. she reads and writes data set files from SAS, SPSS and Stata, and honestly? she's serving range. π
πΈ NAME πΈ
readstat β read and write data set files from SAS, SPSS, and Stata π¦
π SYNOPSIS π
three whole invocation styles, we love a flexible queen:
readstat input-file
readstat [-f] input-file output-file
readstat [-f] input-file metadata-file output-file
π DESCRIPTION π
so basically, readstat converts data set files from the popular statistics packages, and it handles both plain-text and binary formats. no cap. π
β¨ style one: just peeking β¨
in the first invocation style, readstat shows you the metadata from input-file β the row count, column count, text encoding, and timestamp. vibe check on the file, basically.
input-file should be a file with one of these extensions, and each one is its own little icon:
sas7bdatβ SAS binary file, created with SAS version 7 or newer π₯xptβ SAS portable file, version 5 or version 8, created with the SAS XPORT commandsavβ SPSS uncompressed binary filezsavβ SPSS compressed binary file (compressed but make it fashion)porβ SPSS portable filedtaβ Stata binary file, version 104 or newer π
and okay, important lore: if the row count can't be determined from the file header β which is sometimes the case with SPSS binary files and always the case with SPSS portable files β then readstat will report a value of -1. that's not a bug bestie, that's just the truth. π
π style two: the transformation π
in the second invocation style, readstat converts input-file into output-file β like turning a SAS portable file into a Stata binary file, which is giving glow-up montage energy.
on top of the extension list from before, output-file can also have the extension csv or xlsx, which creates a CSV or Excel file respectively. options on options on options. π
π§ style three: the extra-metadata era π§
the third invocation style is the one you reach for when extra metadata about the input file β like value labels or column widths β lives in a separate file. several types of metadata file are supported:
sas7bcatβ SAS binary "catalog" file, created with SAS version 7 or newer, containing value labelsjsonβ JavaScript Object Notation (JSON) file, containing column metadata that cannot be gleaned from the input CSV. for the details, go read the manual page for theextract_metadatacommand πdctβ Stata dictionary file, containing the data layout and column metadata for a plain-text input filespsβ SPSS command file, describing the data layout and column metadata for a plain-text input filespsβ SAS command file, describing the data layout and column metadata for a plain-text input file
ok not me noticing the page lists sps twice β once for SPSS and once for SAS. I'm just the messenger bestie, I promise I'm not the one who did that. π
the last three formats can be used for both fixed-width and delimiter-separated (e.g. tab-separated) input files. these are commonly distributed along with plain-text ASCII data sets. iconic behavior honestly. π
both input and output formats are implied by the file extension. she reads the extension, she knows what to do. main character energy. β
π OPTIONS π
-fβ overwrite any existing output-file. yes she will simply replace it. no hesitation.
π BUGS π
ok so we have to be real for a sec, because there are two things:
- SAS binary files created by
readstatdo not open with current versions of SAS. π - the finer details of format strings (e.g.
"%8.2g") are not properly converted between file formats.
ngl these are the "we know, we're working on it" corner of the page. don't say nobody warned you. π
π AUTHOR π
Copyright (C) 2012-2019 Evan Miller, and others where indicated. π«Ά
and that's the whole page, bestie β this one is from the General Commands Manual, dated 23 January 2019, and it's the READSTAT(1) page. go forth and convert some data sets. periodt. β¨ππ¦
π¦ where this page comes from
- arch rolling: readstat 1.1.9-2 Β· MIT
- debian bookworm: readstat 1.1.8-1 Β· MIT
- debian trixie: readstat 1.1.9-4 Β· MIT
- fedora 43: readstat-tools 1.1.9-6.fc43 Β· MIT
- fedora 43: readstat-tools 1.1.9-8.fc43 Β· MIT
- fedora 44: readstat-tools 1.1.9-9.fc44 Β· MIT
- nixos 26.05: readstat 1.1.9
- nixpkgs unstable: readstat 1.1.9
- ubuntu jammy: readstat 1.1.7-3 Β· MIT
- ubuntu noble: readstat 1.1.9-2.1build2 Β· MIT
- ubuntu questing: readstat 1.1.9-4
- ubuntu resolute: readstat 1.1.9-6build2 Β· MIT
- ubuntu stonking: readstat 1.1.9-6build2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms