Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Convert contents of string variables to lower case


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: Convert contents of string variables to lower case
Date   Fri, 10 Dec 2004 13:20:15 +0000

>>

Try this

foreach var of varlist x1 x2 x3...{
gen Z=lower(``var')
drop `var'
rename Z `var'
}


Dev


>>> [email protected] 12/10/04 1:15 pm >>>
I have a dataset containing numeric and string variables. I'm using foreach 
to loop across all the variables in my dataset.
Within this loop, how do I convert the contents of the string variables to 
lower case?

     

*
*   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/


This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


*
*   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