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

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, 

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index