Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Re: changing variable case
From
Ryan Kessler <[email protected]>
To
[email protected]
Subject
Re: st: Re: changing variable case
Date
Wed, 28 Nov 2012 00:35:32 -0500
Hi Mike,
This can be accomplished by nesting the lower function within a foreach loop:
sysuse auto, clear
foreach v of varlist * {
if substr("`: type `v''",1,3) == "str" replace `v' = lower(`v')
}
Ryan Kessler
On Wed, Nov 28, 2012 at 12:17 AM, Michael Stewart
<[email protected]> wrote:
> Dear Stat List user ,
>
> I am not sue if my previous post was sent in right fashion.Hence i am
> resending the e-mail.
> I have a large dataset with approximately 600 variables. Some are
> upper case and some are lower case.I want to convert all of them to
> lower case. Is there a stata command to convert all variables to lower
> case.I tried varcase_all but it toggles between the variable cases.
>
>
> --
> Thank you ,
> Yours Sincerely,
> Mike.
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/