Statalist The Stata Listserver

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

st: Help with string problem

From   Fred Wolfe <>
Subject   st: Help with string problem
Date   Thu, 24 Aug 2006 21:36:25 -0500

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 |



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

*   For searches and help try:

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