Announcement

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

  • Load data from onedrive / web

    I looked through a few forum posts(post1, post2, post3, post4) but could not find an answer on how to load data file directly from onedrive online. I already have a ondedrive for desktop installed but would still like to be able to use the data directly from the internet (for some reason).

    I create a link for the .dta file stored on my onedrive online.
    Then in stata, I typed

    use "https://1drv.ms/u/s!Ai3TX633y6WwgwSPYrpavoJmKzA0?e=ZvCBHN", clear

    This did not work.
    I also tried the following:
    In onedrive online, I created a link to embed the file
    <iframe src="https://onedrive.live.com/embed?cid=B0A5CBF7AD5FD32D&resid=B0A5CBF7AD5FD32D%21388 &authkey=AFnnLNzjuazLATw" width="98" height="120" frameborder="0" scrolling="no"></iframe>
    I then replaced 'embed' with 'download'. This helps directly download the file upon entering the link. I then used this link in stata as:

    use "https://onedrive.live.com/download?cid=B0A5CBF7AD5FD32D&resid=B0A5CBF7AD5FD32D%21388 &authkey=AFnnLNzjuazLATw", clear

    This did not work either. I get an error:
    file
    https://onedrive.live.com/download?c...D5FD32D%21388&
    > authkey=AFnnLNzjuazLATw.dta not Stata format


    Any suggestions?

  • #2
    That link isn't directly to a .dta file. Rather it goes to a page of Javascript, with a button to download the file. Microsoft doesn't want you to bypass the landing page. I suppose a clever person might be able to do that but the Javascript is fairly opaque to me. Possibly https://stackoverflow.com/questions/...ing-login-page is relevant.

    Comment


    • #3
      This my friend seems like a Python problem, one that you could readily solve in Selenium if you've got Stata 16/17 and the aptitude to learn it.

      I really do recommend you do this by the way, if you've the time, since Python and Stata are a true godsend for issues like this.

      Comment


      • #4
        #2
        [email protected]
        Thank you for your reply. The second link does directly download stata file without redirecting to a page with a button to download the file. The link I posted above had extra space, the following link directly downloads the data file but still did not work.
        https://onedrive.live.com/download?c...FnnLNzjuazLATw
        use "https://onedrive.live.com/download?cid=B0A5CBF7AD5FD32D&resid=B0A5CBF7AD5FD3 2D%21388&authkey=AFnnLNzjuazLATw", clear

        I will try the link you sent and will check if it works that way. Thanks!

        Comment

        Working...
        X