I think this needs a little more explanation.
In your example, the difference between "text"
and "test" looks like a typo. If so,
gen varnew = "test" + varold
would be enough, but I doubt that's what you
mean.
Nick
[email protected]
Hans J. Baumgartner
> I would like to replace some values but the old values should be some
> part of the new values
>
> That is
>
> VARold
> 1
> 2
> 3
>
> should become
>
> VARnew
> text1
> test2
> test3
>
>
> The trick is to be flexible, since I would like to use the
> command in a
> loop and hence the values of VARold may not be constant over
> all loops.
*
* 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/