Statalist


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

RE: st:tips to manage multiple do files?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st:tips to manage multiple do files?
Date   Fri, 19 Sep 2008 16:53:56 +0100

I yield to few in rational admiration for Unix but giving credit where credit is due obliges me to add that Windows has a serviceable _find_ command that you can access from the Command Prompt. Typing ! to open a shell and 

find /? 

gives help. That's not to deny that ports of _grep_ may be more powerful and similar facilities within your favourite text editor may be more convenient. 

Nick 
[email protected] 

Neil Shephard

Man Jia wrote:

> I was wondering if anyone could share any tips of managing many do 
> files for one research project. Thanks for your help!
> ----------------------------------------------
> (1) How to make it easy to find some specific work in several do files?
>
>  Now I have to open most of them to see if the file has the part I'm 
> looking for. The thing is, it is kind of hard to remember clearly  the 
> content of each file after even two or three days not working with 
> them. I tried to write outline in the beginning of each file, but I 
> have to open each of them to get the outline.
>   

I find searching for specific work in text files pretty easy using 
commands such as 'grep' which searches specified text files for regular 
expressions.  It has a heritage from *NIX systems (UNIX/BSD/Linux), but 
even if your using Windows you can install Cygwin 
(http://www.cygwin.com) and have the power of this command (and many 
other very useful and powerful commands).  You can then use a specific 
comment style for your outline and simply search on that regular 
expression to get the outline without having to open the file up.  There 
are various useful flags to this command such as '-R' to search 
recursively '-A #' / '-B #' which will output # lines After /Before the 
matched regular expression and many many more that are detailed in the 
help that comes with it.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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