Statalist The Stata Listserver


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

Re: st: Help with string problem


From   Rafal Raciborski <[email protected]>
To   [email protected]
Subject   Re: st: Help with string problem
Date   Fri, 25 Aug 2006 10:58:02 -0400

you could also use the clean() function in excel first, which removes all nonprintable characters, before pasting into stata.
rafal


Quoting Fred Wolfe <[email protected]>:


To see the difference, I used -outfile- and then examined the two -apatkey-s at the hexadecimal level in a text editor. The key variable that didn't merge contained HEX(AO) characters instead of Hex(20). Hex(A0) is also a "blank" character (a "non-breaking space" in MS office). In HEX the code was "20 A0 A0 22" or space NB-space NB-space ". Somehow this must have been created in the Excel file that was sent to me.

Fred

At 09:36 PM 8/24/2006, you wrote:

Someone sent me a list of IDs (apatkey)for participants registered in our
databank. They sent an Excel file (alas). I pasted it into Stata and later
used StatTransfer, both with the same result.

What I did was to save the IDs sent to me. Then I -used- my databank and
merged the new data in. The problem was that the merge didn't work as
people with the same apatkey didn't merge. Tracing this down, I found that
the length of the merged variable was different from the master variable.
It would seem that there are hidden characters in the case where _merge == 2.

Questions. Does anyone know how to see those hidden characters? Is this a
known problem with the hated Excel?

. replace apatkey=trim(apatkey)
. l apat greger _merge length if index(apatkey, "CLE210928")

+-----------------------------------------+
| apatkey greger _merge length |
|-----------------------------------------|
28469. | CLE210928 . 1 9 |
74437. | CLE210928 1 2 12 |
+-----------------------------------------+

Thanks,

Fred

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel +1 316 263 2125
[email protected]


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

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel +1 316 263 2125
[email protected]


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



================
Rafal Raciborski
Graduate student
Department of Political Science
Emory University
301 Tarbutton Hall
1555 Dickey Drive Atlanta, GA 30322
404-315-7498 (home)
[email protected]
http://www.roofoos.net/


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