Announcement

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

  • Import vs Insheet: Differences in the number of observations

    Dear all,

    I know that insheet has been superseded by import delimited. However, I obtained different results using one or another.

    When I use:
    import delimited "C:\Myfile.txt", delimiter(tab) varnames(1) asdouble clear
    I get (14 vars, 29346 obs)

    Instead, with: insheet using "C:\Myfile.txt", clear
    The result is (14 vars, 29,542 obs)

    I double checked the file in the wordpad and Excel, and the correct number of observations is 29542. I also tried several encondings (Stata 14.0) and the results are the same.
    For some reason, import do not includes the last 196 rows. At the breakpoint there is no special character or change in the format.

    Is there any update that I am missing?

    Best,

    Daniel Oda


  • #2
    I have experienced the same problem using Stata 14 though with .csv files, not txt. Does anyone have a resolution? I have continued using -insheet- as it appears to properly load my data every time.

    Comment


    • #3
      Welcome to Statalist!

      You should look at your text file in an editor and see if perhaps it contains any double quote characters within the data. If so, perhaps the final post in this topic will help.

      http://www.statalist.org/forums/foru...ollapse-option

      Comment

      Working...
      X