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

st: -trim()-ed but cannot -destring()-:- hidden text characters?


From   Daniel Egan <[email protected]>
To   [email protected]
Subject   st: -trim()-ed but cannot -destring()-:- hidden text characters?
Date   Tue, 26 Apr 2005 10:07:17 -0400

Hello list, 

I am having a strange problem converting strings into numerical
format. I have a string which by all appearances is just a number. I
used trim() to make sure there weren't any hidden spaces, and then
attempted to -destring- again but with no luck. Trim indicates that
there weren't any changes made upon -trim-ing again...


If I -destring, force- I do get missing values for the majority of
values which appear to be trimmed numbers.

the file is at: 
http://www.geocities.com/verbosemonkey/stata/sonj.zip

*****************************
foreach var of varlist _all {
replace `var'=trim(`var')
}
destring rank, replace
destring rank, gen(nrank) force
tab rank if nrank==.
****************************


Are there other "hidden" characters which could be preventing
-destring- which I can erase?

Much thanks, 
Dan

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