[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: AW: Work with many Do files simultaneously

From   "Eric A. Booth" <>
Subject   Re: st: AW: Work with many Do files simultaneously
Date   Wed, 22 Apr 2009 10:44:41 -0500

Austin's program is great. I might add to his comment about an OS utility that if you've got a Mac you might try this command from the Stata command window:

!mdfind word(s)

it's a pretty powerful tool. You can set some constraints for mdfind to only look in the 50 Do-Files you mentioned by using a command like:

 !mdfind word(s)  -onlyin DoFileFolder

Finally, you can always use a freeware program like Google Desktop to quickly search your do-files.


Eric A. Booth
Public Policy Research Institute
Texas A&M University
Office: +979.845.6754
Fax: +979.845.0249

On Apr 22, 2009, at 10:28 AM, Austin Nichols wrote:

Or a OS utility ( but try:

clear all
prog find
version 10.1
syntax [anything] [, Match(string asis)]
foreach f of local anything {
tempfile t
filefilter `"`f'"' `t', from(`"`match'"') to("")
loc n=r(occurrences)
if `n'>0 & `n'<. {
di `"`n' matches found in `f'"'
*could also display relevant lines of file here
cd `c(sysdir_base)'a
loc t : dir . file "*.ado"
find `t', match(version 8)

On Wed, Apr 22, 2009 at 10:43 AM, Martin Weiss <> wrote:


That sounds more like a case for a decent text editor than Stata. "Find in
Files" is standard fare for most of them...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von
Gesendet: Mittwoch, 22. April 2009 16:41
Betreff: st: Work with many Do files simultaneously

Dear listers,

I have 50 Do files and I want to find only one word. How can I explore
simultaneously these 50 Do files to find this word in Stata 10?

Regards, Luis

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index