...
As long as you get the column numbers correct, infix will work OK.
.
. /*
> save this to PS2_Data_2Bank.txt
> 3.0000000e+000 2.0000000e+000 1.5910692e+006 1.7318119e+006 1.8748141e+006 3.6291198e+004 7.0991674e+004 1.0588570e+005
> */
.
.
. infix d1 1-16 d2 17-32 rminus1 33-48 r1 49-64 rplus1 65-80 rminus2 81-96 r2 97-112 rplus2 113-128 using PS2_Data_2Bank.txt, clear
(1 observations read)
.
. list
+-----------------------------------------------------------------------+
| d1 d2 rminus1 r1 rplus1 rminus2 r2 rplus2 |
|-----------------------------------------------------------------------|
1. | 3 2 1591069 1731812 1874814 36291.2 70991.67 105885.7 |
+-----------------------------------------------------------------------+
.
______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
If you live to be one hundred, you've got it made.
Very few people die past that age – George Burns
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of László Sándor
Sent: Monday, 19 October 2009 3:15 AM
To: [email protected]
Subject: st: infixing numbers in exponential format
Hi all,
I'm trying to read data from a textfile which recorded the numbers in
a 3-digit exponential format. Though the numbers exactly look like
examples under -help format##eformat- in Stata, I could not infix the
data.
Could somebody familiar with such issues check quickly whether I am
making a mistake, or suggest how I need to edit the textfile before I
can infix it?
My command looks like this:
infix d1 1-16 d2 17-36 rminus1 37-56 r1 57-76 rplus1 77-96 rminus2
97-116 r2 117-136 rplus2 137-156 using PS2_Data_2Bank.txt, clear
The first line of my data reads like this:
3.0000000e+000 2.0000000e+000 1.5910692e+006 1.7318119e+006
1.8748141e+006 3.6291198e+004 7.0991674e+004 1.0588570e+005
And a sample error message I got reads like this:
'2.0000000e' cannot be read as a number for d2[1]
Thank you!
Laszlo
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/