ds, has(type string)
foreach v of varlist `r(varlist)' {
replace `v' = lower(`v')
}
Nick
[email protected]
Dev Vencappa
>
> Try this
>
> foreach var of varlist x1 x2 x3...{
> gen Z=lower(``var')
> drop `var'
> rename Z `var'
> }
[email protected]
> 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/