Statalist


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

st: importing changes variable to numeric but want string variable


From   "Ms. Marilyn Ibarra" <ibarra@uga.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: importing changes variable to numeric but want string variable
Date   Fri, 8 Feb 2008 14:14:39 -0500 (EST)

I have a text file with data that looks like this:

us_id    firm_name
000007    x
012231    y
100210    z
345211    w

I imported the txt file.  When I do this I get data that looks like this:

us_id    firm_name
7         x
12231       y
100210    z
345211    w

As you can see the zeros at the beginning of the first two observations of us_id are dropped.  How do I prevent this from happening because I need it in the format of the original txt file.  I need it to be a string variable and not numeric.  

Any ideas?  Thanks in advance,

Marilyn.   


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index