1EXTRACT_METADATA(1) General Commands Manual EXTRACT_METADATA(1)
2
3
4
6 extract_metadata - read column metadata from SPSS and Stata binary
7 files, and format it as JSON
8
10 extract_metadata input-file output-file
11
13 extract_metadata reads column metadata from existing binary data files,
14 so that readstat can produce new, column-compatible binary files from
15 CSV input files. Both programs use JSON as a metadata interchange for‐
16 mat.
17
18 The input-file should be a file with one of the following extensions:
19
20 dta Stata binary file, version 104 or newer
21
22 sav SPSS uncompressed binary file
23
24 zsav SPSS compressed binary file
25
26 In all cases, output-file should end in .json.
27
29 Suppose you have a Stata file with last year's survey data, and want to
30 produce a compatible Stata file containing this year's survey data.
31 First, extract the metadata:
32
33 extract_metadata last-year.dta survey-metadata.json
34
35 Now apply it to this year's data, which is stored in a CSV file:
36
37 readstat this-year.csv metadata.json this-year.dta
38
39 The first line of the CSV file should contain column names which match
40 the column names in last-year.dta. If everything went well, your new
41 binary data set is now stored in this-year.dta.
42
44 None.
45
47 Copyright (C) 2012-2019 Evan Miller, and others where indicated.
48
49
50
51 01 February 2019 EXTRACT_METADATA(1)