Thanks, Gabi, this definitely worked!
I shouldn't have shied away from some work.
However, the capabilities of infix for such a case could be a bit
better documented, esp. as it differs from other infiling commands.
Thank you again,
Laszlo
On Sun, Oct 18, 2009 at 3:36 PM, Gabi Huiber <[email protected]> wrote:
>
> I took your line and saved it as a text file, then I replaced all
> multiple blank spaces with just one. Then I did this:
>
> __ code starts here
>
> set type double
> insheet using "laszlo sandor example.txt", delimit(" ")
>
> __ and ends here
>
> Here's what I saw in the data browser:
>
> v1 v2 v3 v4 v5 v6 v7 v8
> 3 2 1591069.2 1731811.9 1874814.1 36291.198 70991.674 105885.7
>
> Would this work for you?
>
> Gabi
>
> 2009/10/18 László Sándor <[email protected]>
> >
> > 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/
*
* 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/