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

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

From   <>
To   <>
Subject   st: AW: renaming path name in 100 do-files
Date   Fri, 25 Sep 2009 09:46:30 +0200

Raoul wrote:
> I received around 100 different do-files from a colleague, but the
path name in each do-file is different from my computer because the
do-files were on a different computer. Is there any easy way to change
the path in each do-file without having to physically open each
do-file and replace the path name?

As Dan Blanchette wrote, a combination of "rcd" and "filefilter" will do
the job within Stata.

I once solved the same task with windows search and an editor

1. Search for "*.do"-files in the given directory (including
2. Mark results (exlude unwanted results manually if needed)
3. Open files in editor (context menu -> "open with") (Notepad++ had no
problem with >100 files)
4. Search and replace string in all open files
5. Save all files (with one click in Notepad ++)

This only takes a few minutes.
It's a manual approach but that might be favourable with "foreign"
do-files. You have better insight in the process. 

Best wishes 
Stefan Gawrich

*   For searches and help try:

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