Announcement

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

  • Importing*.sav files from sub-directories using loop.

    Hi,
    I am trying to import .sav files from all sub-directories using the following, but nothing is happening. Can you please correct what I am doing wrong:

    Code:
     cd  "dir"
    
    local files: dir "." files "*.sav"
    
    foreach file of local files {
      importsav `file', recursive
     }

    (Importsav from ssc)

    Thank you.



    Last edited by Sonnen Blume; 16 Oct 2021, 10:48.

  • #2
    Sonnen Blume Are these files you're getting public? That is, is there a URL I can go to to get these, too?

    Anyways: What do you mean by nothing is happening? Are you expecting for all of these files to be imported at once, stacked on top of one another?

    I presume you're using Stata 17, and if I'm not mistaken, Stata 17 just allows you to import SPSS data now, right?

    Comment

    Working...
    X