Statalist


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

st: I can't get fs to work from inside a do file


From   Gabi Huiber <ghuiber@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: I can't get fs to work from inside a do file
Date   Fri, 15 Feb 2008 21:24:00 -0500

Hello all,

Nick Cox has this little command called fs, which reads the files in a
certain folder and remembers them in r(files). I tried to use it to
run a bunch of do-files from inside a root do-file, because the name
and number of these subsequent do-files can vary between the
sub-folders of interest. So here's what I did:


. ***************** CALL DO-FILES SPECIFIC TO EACH ${paper} HERE
.
. fs prototype/${paper}/*.do
> local dofiles=r(files)
>
> foreach k of local dofiles {
> do "prototype/${paper}/`k'"
> }
>
> clear
> di "goodbye"

As you can see, Stata breezes right through the lines after fs. It
also does not interpret fs: display r(files) shows nothing. However, I
can copy the fs line from the results window and paste it in the
command window, and it will execute just fine. Ditto for all the lines
below it.

Any ideas?

Thank you,
Gabi

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index