Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Reading data with infix: record too long


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Reading data with infix: record too long
Date   Mon, 4 Aug 2008 12:40:49 +0100

You have here results on two files. 

As I understand it, 

pme2001pe.dat is one long record with _only_ binary 0 characters. There
is no point in reading this into Stata. It means something, presumably,
if you can find out what binary 0 means from your data source, but
reading it into Stata will not help you find out more about it than is
already evident. 

pme2001sp.dat is almost entirely binary 0 characters. There is some
other stuff. 
My guess is that you may have to get rid of those binary 0 characters,
but I don't know. 
There is some indication that lines are of very irregular length. 

I think you need to go upstream and find out more from somebody about
what should be in these files. Alternatively, a very good text editor
may help you work out what is going on. 

As both files are binary, -infix- is unlikely to be the right command. 

Nick
n.j.cox@durham.ac.uk 

b.tracy

(Using Stata 9)

While trying to infix a dataset, I received the 'record too long' error,
and I subsequently read the thread "Re: st: reading data with infix:
record too long."

I have checked my data with -hexdump, analyze- but I do not know what
solutions are available to me after doing so. I have a number of
state-level datasets which give different results when using -hexdump-.
In the first case below, no data is read; in the second case, only 109
lines are read before the error appears.

What are my options, if any, to get this data into Stata?

Regards,
Brandon.

. hexdump "pme2001pe.dat" ,analyze

  Line-end characters                        Line length (tab=1)
    \r\n         (DOS)                  0      minimum
19,542,038
    \r by itself (Mac)                  0      maximum
19,542,038
    \n by itself (Unix)                 0
  Space/separator characters                 Number of lines
1
    [blank]                             0      EOL at EOF?
no
    [tab]                               0
    [comma] (,)                         0    Length of first 5 lines
  Control characters                           Line 1
19,542,038
    binary 0                   19,542,038      Line 2
.
    CTL excl. \r, \n, \t                0      Line 3
.
    DEL                                 0      Line 4
.
    Extended (128-159,255)              0      Line 5
.
  ASCII printable
    A-Z                                 0
    a-z                                 0    File format
BINARY
    0-9                                 0
    Special (!@#$ etc.)                 0
    Extended (160-254)                  0
                          ---------------
  Total                        19,542,038

  Observed were:
     \0

. hexdump "pme2001sp.dat" ,analyze

  Line-end characters                        Line length (tab=1)
    \r\n         (DOS)                109      minimum
41
    \r by itself (Mac)                  0      maximum
28,329,218
    \n by itself (Unix)                 0
  Space/separator characters                 Number of lines
110
    [blank]                        18,975      EOL at EOF?
no
    [tab]                               0
    [comma] (,)                         0    Length of first 5 lines
  Control characters                           Line 1
481
    binary 0                   28,329,188      Line 2
41
    CTL excl. \r, \n, \t                0      Line 3
811
    DEL                                 0      Line 4
261
    Extended (128-159,255)              0      Line 5
371
  ASCII printable
    A-Z                                 0
    a-z                                 0    File format
BINARY
    0-9                            13,575
    Special (!@#$ etc.)                 0
    Extended (160-254)                  0
                          ---------------
  Total                        28,361,956

  Observed were:
     \0 \n \r blank 0 1 2 3 4 5 6 7 8 9
 

*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index