Statalist


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

Re: st: importing changes variable to numeric but want string variable


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: importing changes variable to numeric but want string variable
Date   Fri, 8 Feb 2008 14:35:43 -0500

See examples in:
 help infile2

Best, Sergiy

On 2/8/08, Ms. Marilyn Ibarra <ibarra@uga.edu> wrote:
> 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/
>
*
*   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