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

Re: st: renaming path name in 100 do-files

From   Dan Blanchette <>
Subject   Re: st: renaming path name in 100 do-files
Date   Thu, 24 Sep 2009 11:18:09 -0400 (EDT)

Nikos Askitas ( and I have a command called -rcd-
that is available on the SSC:
 . ssc install rcd

It's a prefix command that lets you run other Stata commands.  It
cds around to as many directories as you want and runs the Stata

rcd [directory_name], [verbose] [depth(integer >= 1)] [dirfilter(regular expression)] [: command]

I would think you could run -filefilter- with it by making a do-file
in one directory that will be run in all desired directories:

 . rcd "C:\my_data\" , dirfilter(".progs") : do "C:\my_data\"

where is:
  foreach file in `r(files)' {
    filefilter `file' `file'new, from(<oldpath>) to(<newpath>)

Hope this helps,

Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business

"r.c.reulen" <>
Thanks for the suggestions. I failed to mention that the do-files are
in several sub (and sub-sub) folders as well, which would make the
task more complicated.....

*   For searches and help try:

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