From | Ada Ma <[email protected]> |
To | [email protected] |
Subject | Re: st: rename variables UPPERCASE to lowercase |
Date | Mon, 26 Apr 2004 15:39:10 +0100 |
Independently, Nick Winter has suggested what
I suggested as a solution using only official commands. However, his version is correct in remembering the " " in
. rename `v' `=lower("`v'")'
and mine is incorrect.
Nick [email protected]
Nick Winter
I need to convert all variable names from UPPERCASE tolowercase. How can
. foreach var of varlist * {I do that?
. rename `v' `=lower("`v'")'
. }
This will cycle through every variable in the dataset, renaming each to its equivalent, all-lower-case self.
Or I'm sure there are canned solutions out there, but this is a case, for me at least, where knowing a bit about -foreach- and local macros is far easier than remembering which canned solution does this little job...
* * 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 |