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

Re: st: RE: Reading a tab-delimited text file; version 8.2


From   Joe McCrary <joe.mccrary@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Reading a tab-delimited text file; version 8.2
Date   Thu, 5 Jan 2006 08:55:35 -0500

Thanks Nick. I suspect that any non-numeric characters would be
'#NULL' for missing data.

On 1/4/06, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> From this example, you could just read
> them in as numeric anyway, and then pad with
> leading zeros.
>
> sysuse auto
> tostring mpg, format(%04.0f) gen(s_mpg)
>
> This won't work if there are non-numeric
> characters in the variables concerned.
>
> Nick
> n.j.cox@durham.ac.uk
>
> Joe McCrary
>
> > I've got a number of tab-delimited text files that I'm reading into
> > STATA 8.2 using insheet. The problem I'm having is that the first 3
> > variables need to be read is as text, not numeric. Here is one line of
> > data:
> >
> > 86309 0060    010051000229    0       84      69      66
> > 48    69      75      84      78      87      81      75
> > 63    69
> >
> > In looking over the infile/dictionary commands, it appears that I
> > cannot specify a delimeter in the dictionary file.
> >
> > Could someone please tell me how to read those first 3 in as strings?
>
> *
> *   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/
>


--
"No problem can be solved from the same level of consciousness that created it."
--Albert Einstein

Joe McCrary

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