logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

extract_metadata - read column metadata from SPSS and Stata binary files, and format it as JSON

Author

       Copyright (C) 2012-2019 Evan Miller, and others where indicated.

                                                01 February 2019                             EXTRACT_METADATA(1)

Description

extract_metadata reads column metadata from existing binary data files, so that readstat can produce new,
       column-compatible  binary  files  from  CSV input files. Both programs use JSON as a metadata interchange
       format.

       The input-file should be a file with one of the following extensions:

       dta    Stata binary file, version 104 or newer

       sav    SPSS uncompressed binary file

       zsav   SPSS compressed binary file

       In all cases, output-file should end in .json.

Example

       Suppose you have a Stata file with last year's survey data, and want to produce a compatible  Stata  file
       containing this year's survey data. First, extract the metadata:

              extract_metadata last-year.dta survey-metadata.json

       Now apply it to this year's data, which is stored in a CSV file:

              readstat this-year.csv metadata.json this-year.dta

       The first line of the CSV file should contain column names which match the column names in last-year.dta.
       If everything went well, your new binary data set is now stored in this-year.dta.

Name

       extract_metadata - read column metadata from SPSS and Stata binary files, and format it as JSON

Options

       None.

Synopsis

extract_metadatainput-fileoutput-file

See Also