Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Windows (& Vista) will not search within do files.


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: Windows (& Vista) will not search within do files.
Date   Thu, 21 Jun 2007 09:58:22 -0400

At 05:17 AM 6/21/2007, Paul Seed wrote:

I am running Stata version 9.2 (fully updated) on a Dell Latitude with
Microsoft Windows XP (5.1 build 2600)..

Whenever I open Windows explorer & try to search for a do file, containing a
particular piece of text, no files are found. This is so however many
do files there actualy are with the relevant text. This does not affect any
other file type; indeed changing the extension to (e.g.) txt "solves" the
problem, and files can then be found. . But changing the extensions on all my
do files to something else is not feasible even as a work-around.
[...]
Several people have given useful suggestions. I will tell how I handle this. I do it the old-fashioned way -- in the command prompt using the -find- command. (And I never had the problem Paul mentioned; I wasn't even aware of it.) I may be out-of-date, but to me this is an example of how modern user-interfaces have become so complex that they cause more problems than they solve.

In the Windows command prompt, type
help find
to learn about it.

In a typical usage, I might type
find "mytext" *.do

Note that is is, by default, case-sensitive, which is okay if you are searching for Stata variable names. For a case-insensitive search, use the /i switch.

find /i "mytext" *.do

If the resulting output is long, you can use -more-:

find "mytext" *.do |more

Or you can direct the output:

find "mytext" *.do >aaa
where aaa either does not yet exist as a filename, or is a file that you don't mind overwriting. You can then view the file afterwards.

(In earlier days, I often combined -find- with -for-. Due to some improvements in -find-, it is usually not necessary, but it is something that may be worth being aware of.)

HTH
--David

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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