
From  "Ni Frank" <frankflying03@hotmail.com> 
To  statalist@hsphsun2.harvard.edu 
Subject  Re: st: ONE STATA QUESTION ON READING DATA 
Date  Mon, 19 Mar 2007 04:46:24 0400 
[716]
'.000000.0000001.00000.000000' cannot be read as a number for col1[864] '351.000001.00000' cannot be read as a number for col1[867] ....... .......
From: "Svend Juul" <SJ@SOCI.AU.DK>_________________________________________________________________
ReplyTo: statalist@hsphsun2.harvard.edu
To: <statalist@hsphsun2.harvard.edu>
Subject: Re: st: ONE STATA QUESTION ON READING DATA Date: Mon, 19 Mar 2007 09:07:11 +0100
Frank wrote:
Can anyone help me to solve this problem?
I have a (large) dataset in ASCII file. It contains
N colomn data (numerical numbers). I only want to read
part of them, for example, from 5th column to 10th
column into STATA, how to do that?
 and later, after some advice:
When I use the command
infile col1col5 using C:\statafile\grade2006.raw, clear
why it says " file C:\statafile\grade2006.raw not found" ?
( By the way, my data is in grade2006.txt file. )

Obviously, if the filename is grade2006.txt, use that name:
infile col1col5 using C:\statafile\grade2006.txt, clear
As to the first part of the question: I guess you have a fixed
format ASCII file like this
6526399317663163...
2033027247525752...
6363281072117388...
3660269579850137...
So column 5 to 10 in the first observation contains 393317.
If this represents three different twodigit variables which
you want to give the names v1v3, use:
infix v1 56 v2 78 v3 910 using C:\statafile\grade2006.txt, clear
Hope this helps
Svend
__________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK8000 Aarhus C, Denmark
Phone: +45 8942 6090
Home: +45 8693 7796
Email: sj@soci.au.dk
__________________________________________
*
* 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–2015 StataCorp LP  Terms of use  Privacy  Contact us  What's new  Site index 