Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata insheet error:too many variables specified

    Hi everyone,
    I've got a problem insheet a csv.
    I tapped "insheet using "D:\user\data.csv" , and it showed:
    Click image for larger version

Name:	1.png
Views:	1
Size:	5.1 KB
ID:	1646336

    but the CSV only contains 448,430 lines (with first line being variable names)
    How do I cope with this ? Thanks !!

  • #2
    Maybe try something like the following. (-insheet- won't let you specify row ranges.)
    Code:
    import delimited using D:\user\data.csv,  rowrange(1:448430)
    You also might want to use a text editor to take a look at what's in that last line.

    Comment


    • #3
      it is also possible that there are characters in the csv file that are confusing Stata re: end-of-line; you can use the -hexdump- command to look at this; if you do use -hexdump- make sure you add options as you almost certainly do not want a full dump; the options that I generally find most useful are "analyze" and "tabulate"; see
      Code:
      help hexdump

      Comment

      Working...
      X