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 <[email protected]>
To   [email protected]
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 stata.com.
>
> 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 profile.do (see -help profile) or in 
project master files. For example your profile.do might read like this

---------------------profile.do
global ourprojectdata "m:/workgroup/datasets/ourprojectdata"
global ourproject "c:/My Files/projects/ourproject"
----------------------------------

and profile.do on your collegues machine might read like this:

---------------------profile.do
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
uli

-- 
[email protected]
+49 (030) 25491-361


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