Announcement

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

  • Download and unzip file with Stata

    Hi,

    I was wondering if it is possible to download a *.zip file from a website, unzip the *.csv file it contains and open it in Stata. If unzip is not possible, I would be happy to know how to download a file from Stata directly.

    I am trying to access the ME Breakpoints from the Kenneth R. French data library
    https://mba.tuck.dartmouth.edu/pages...a_library.html

    The link to the file I want to download is here:
    https://mba.tuck.dartmouth.edu/pages...points_CSV.zip

    Thanks a lot in advance.


  • #2
    Both downloading and unzipping are covered in this post on The Stata Blog.

    Code:
     // download to cwd  
    copy https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/ME_Breakpoints_CSV.zip ///    
        ME_Breakpoints_CSV.zip  
    
    // unzip in cwd  
    unzipfile ME_Breakpoints_CSV.zip  
    
    // import as usual, start with line 2
    import delimited "ME_Breakpoints.CSV", delimiter(comma) varnames(nonames) rowrange(2) clear
    Last edited by Arthur Morris; 04 Aug 2020, 23:39.

    Comment


    • #3
      Spectacular, thank you so much Arthur!

      Comment

      Working...
      X