Don't know why this never took off - I'm sure I publicized it years ago. For anyone who's interested, put this program in your local ado directory. It's used after opening a data file. I keep projects in separate directories and at the start of session use File/Recent files to load the data, then type <godir> to make that the working directory. Simples! If anyone can improve the code, please do.
program godir
version 8
if strpos(reverse("$S_FN"),"/") {
local lastslash = length("$S_FN")-strpos(reverse("$S_FN"),"/")
}
else {
local lastslash = length("$S_FN")-strpos(reverse("$S_FN"),"")
}
local target = substr("$S_FN", 1,`lastslash')
if strpos("`target'", ".dta") local target= "`c(pwd)'"
cd "`target'"
end
Related Posts with godir - for working in directories
How to view the SE of autocorrelation in xtregarI'm estimating a model using xtregar, fe. The results include an estimate of rho (rho_ar), but I can…
Repeated measures, do GEE, mixed models or logistic regressionHello, I know there are many postings on this topic but I am still a bit confused. I have cohort …
Danish MP's political responsiveness - help with statistical significanceHello everyone Me and a fellow student are currently working on an assignment investigating politic…
Problem with displaced coefficients using -coefplot-Dear Statalisters, I want to plot regression coefficients using the Stata journal command -coefplot-…
How to calculate the team size?I have a dataset as below. There are two columns, one is the team ID, the other is the team member I…
Subscribe to:
Post Comments (Atom)
0 Response to godir - for working in directories
Post a Comment