I have a dataset with several variables named:
datax1 datax2 datay1 datapt datafj
and I'd like to remove the 4 first characters of each to get variables
with names:
x1 x2 y1 pt fj
I tried:
foreach var of varlist data* {
local newname substr(`var', 4, length(`var')-2)
rename `var' `newname'
}
It seems that the standard string functions may not apply to macros. Any
ideas on how to do this? Are there string functions specific to macros? I
was looking at the documentation for macro extended functions but did not
find something that would seem to do it.
thanks in advance,
martin
--
Linux is user friendly. It's just very particular about who it's friends are.
*
* 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/