Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unzipping and importing .gz files in Stata

    Hi,

    I am wondering if it is possible to unzip a folder containing .gz files in Stata, to then import the .gz files and save as .dta files. I am using Stata/IC (64-bit) 16.1 on windows.

    I have downloaded 7zip and can unzip the files using this, so this is an option if they cannot be unzipped in Stata, however is it then possible to import .gz files into Stata and then save as .dta?

    Thanks so much.



  • #2
    You can call external programs using the `shell` command to access your operating system. See `help shell`

    You would have to look into how 7z works from the command line:

    `shell 7z -h`


    My understanding is that.gz files are themselves compressed files or folders, so how you get the data into Stata will depend on the type of underlying data file.

    Comment

    Working...
    X