Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: truncate folder path in Stata 7?

From   Ulrich Kohler <>
Subject   Re: st: truncate folder path in Stata 7?
Date   Wed, 10 Dec 2003 09:38:32 +0100

Dietrich Drüner wrote:
> how can I truncate the first levels of the folder path where I want to load
> or save datasets in Stata 7 (for Windows)?
> I am using Stata on two different computers with a very similar folder
> structure. It looks about like: "...\MyFiles\Dissertation\dataanalysis\.."
> but the first three or four path levels are different due to the folder
> structure of the operating system.
> I remember that in an older version (4 or 5) of Stata there was a simple
> command that made Stata search for the appropriate path. But I can't find
> anything in the help files or at
> It's always a dull work to change all do-files that I have saved on the
> other computer when I want to use them on the second.

How about defining global makros in (see -help profile) or in 
project master files. For example your might read like this
global ourprojectdata "m:/workgroup/datasets/ourprojectdata"
global ourproject "c:/My Files/projects/ourproject"

and on your collegues machine might read like this:
global ourprojectdata "/home/collegue/datasets/projects"
global ourproject "/home/collegue/ourproject"

Then you can run Do-Files on both machines which contains commands like this:

. cd "$ourproject"
. use "$ourprojectdata/maindata"
. log using "$ourproject/an1", replace
. scatter varlist, saving("$ourproject/graphs/mygraph, replace)

many regards

+49 (030) 25491-361

*   For searches and help try:

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