Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Changing specific letter in observations from string variable


From   Philipp Rehm <[email protected]>
To   [email protected]
Subject   Re: st: Changing specific letter in observations from string variable
Date   Mon, 04 Aug 2008 11:21:44 +0200

.
-subinstr()- is your friend.

Example:

clear

input str7 wrong
BA�OS
SA�O
CA�ARIS
HUA�EC
end

gen right=subinstr(wrong,"�","�",.)

HTH,
Philipp

Max Perez Leon wrote:

Hello,
I have a dataset that has the following problem:

I suppose my dataset had some problem in a conversion from dbf to dat and now, some observations in one of my string variable have the next form:
...
BA�OS
SA�O
CA�ARIS
HUA�EC
...

but they should be:

...
BA�OS
SA�O
CA�ARIS
HUA�EC
...

How could I change that single letter?
Thanks,
Max PUCP-IEP







*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/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/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