Hi. I would like to search through all my do files for the word "lasso". Is there any command that can do this? Thanks!
-
Login or Register
- Log in with
// FIRST MAKE SURE YOUR CURRENT WORKING DIRECTORY IS THE ONE CONTAINING THE FILES TO BE SEARCHED // CREATE A DATA SET OF THE PATHNAMES filelist, pattern(*.do) // READ IN THE FILES gen strL contents = fileread(dirname+"/"+filename) // IDENTIFY THE ONES CONTAINING THE TARGET STRING gen long foundit = strpos(contents, "lasso") // SHOW THE RESULTS list if foundit
Comment