Announcement

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

  • How to capture the results of lookfor_all to local files?

    Hi,

    I am searching for (lookfor_all from ssc) all datasets in a directory that contain the target variables and then append them into one dataset. I was previously suggested to the start with the following to combine all datasets in the directory:
    Code:
    local files: dir . files "*dta"
    But this time is a bit different as I want to add only the files returned by the lookfor_all command. I tried the following to capture the output to -local files- :

    Code:
    local files:  lookfor_all "*dta"
    But this does not seem right.

    My second option was to load the datasets one by one and store them as different frame names (a, b, c, d...) and then apply the frameappend (ssc) command, but it also returns error.

    Code:
    frameappend a b c d

    Please let me know if there is any way to do this, adding a selected list of files into local.

    Thank you.



  • #2
    is lookfor_all.ado still available? From where (have been searching without success)? And does it work in STATA 18

    Comment


    • #3
      as the OP said in #1, it is from SSC and it is still there; try
      Code:
      ssc desc l
      which will give you a list in aphabetic order and you will see the program

      if your search failed, how did you search? so we can offer advice

      Comment

      Working...
      X