Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: inputting string variables in comma-separated files


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: inputting string variables in comma-separated files
Date   Tue, 18 May 2004 19:46:19 +0100

A good bet in this circumstance is to make 
it a string variable again using -tostring-. 
Make sure you specify a format which produces
leading zeros. 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of 
> Rebecca Kalmus
> Sent: 18 May 2004 19:36
> To: [email protected]
> Subject: st: inputting string variables in comma-separated files
> 
> 
> Dear Stata users,
> 
> When inputting a comma-separated file using infile or 
> insheet, how can I
> force Stata to read a variable as string?  I have a variable 
> that Stata
> automatically reads as numeric, but contains leading zeros 
> that are lost
> when read as numberic.  I'd like to force Stata to read this 
> variable as
> string instead.
> 
> Thanks,
> 
> Rebecca Kalmus
> *
> *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index