Hi,
I am trying to rename all my variable names to be completely lowercase. Some of them are have them are like this: Blah_blah, others are like this: blah_Blah, etc. I don't want to have to list out every single variable that I want to rename. I have looked through past forum questions, and the following have NOT worked for me:
foreach var of varlist _all {;
gen Z=lower(`var');
drop `var';
rename Z `var';
};
foreach var of varlist _all {;
local lower = lower(`var');
rename `var' `lower';
} ;
Both tell me "type mismatch."
Note: I use ; as a delimiter.
Thanks,
Alyssa Beavers
I am trying to rename all my variable names to be completely lowercase. Some of them are have them are like this: Blah_blah, others are like this: blah_Blah, etc. I don't want to have to list out every single variable that I want to rename. I have looked through past forum questions, and the following have NOT worked for me:
foreach var of varlist _all {;
gen Z=lower(`var');
drop `var';
rename Z `var';
};
foreach var of varlist _all {;
local lower = lower(`var');
rename `var' `lower';
} ;
Both tell me "type mismatch."
Note: I use ; as a delimiter.
Thanks,
Alyssa Beavers
Comment