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

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

From   "Nick Cox" <>
To   <>
Subject   RE: st: AW: Work with many Do files simultaneously
Date   Wed, 22 Apr 2009 16:41:20 +0100

Luis did not specify OS, but for those on Windows, note that even
Windows has its own flavour of -grep-, called -find-. Typing 

find /? 

at a command prompt reveals the syntax. On the other hand, the windowed
variety of this has, in my experience, often failed to find things that
do exist. 


Austin Nichols

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 <>

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

> 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?

*   For searches and help try:

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