Announcement

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

  • Listing all dta files used in a do file

    Is there a command or way for me to list all the dta files that are used or called in a single do file?
    (preferably excluding the files saved by the do file)

    Thank you.

  • #2
    If you reference the files with the extension ".dta", you can parse the do file and extract the names.


    Code:
    import delimited myfile.do
    egen v= concat(v*)
    gen dofile= ustrregexs(1)+".dta" if ustrregexm(v,  ".*\s(.*)\.dta")
    contract dofile, nomiss
    list, sep(0)

    Comment

    Working...
    X