Announcement

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

  • Import Jason "too many veriables"

    Hei,

    i have a big json file which i try to import to Stata. Using

    insheet using "C:\Users\stinavn/filnavn.json"

    returns the error-message

    too many variables specified
    error in line 0 of file


    The file is too big to open in text-editor. Is there a method to read in only variable number 1-10? Altenativly to split the dataset? Cant share the dataset since its classified.

    Thx
    Elisabeth

  • #2
    insheet is outdated. More importantly, insheet did not and does not read JSON files. In fact, I do not think that Stata has a built-in JSON reader (probably because JSON may contain data structures that are not directly compatible with Stata's datasets). You might be interested in Billy Buchanan's jsonio from SSC.

    Comment


    • #3
      daniel klein
      There is also another project that I worked on that includes some JSON parsing functionality that I presented on at last year's Stata Conference: https://wbuchanan.github.io/stataConference2020-readit. The use case is targeted at cases where there are multiple files that someone wants to read into Stata at once, but it could also be used for a single file. The JSON stuff gets a bit funky since it is using some of the tools built into the Pandas library in Python, but it could also potentially provide another viable solution.

      Comment

      Working...
      X