Announcement

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

  • Export Excel: Long String

    Hi All,

    I am using the export excel command to export my Stata dataset into Excel but my string variables get truncated. I have some very long string variables (2 - 3 sentences) and I am using Stata 12. Is there a way to specify the length of my string responses or just say export all the string responses

    Thank you,
    Marvin

  • #2
    Marvin,

    since you don't show your exact code, I can only guess. If you look at the technical note in the import/export excel helpfile, it says

    For an Excel .xls-type workbook, the worksheet size limits are 65,536 rows
    by 256 columns. The string size limit is 255 characters.

    For an Excel .xlsx-type workbook, the worksheet size limits are 1,048,576
    rows by 16,384 columns. The string size limit is 32,767 characters.
    So, I would assume, you exported to a .xls-file while you should probably specify the extension .xlsx, provided you have installed Excel 2007 or later.

    Regards,
    Martin

    Comment


    • #3
      Hi Martin,

      I follow your instruction and export as xlsx. thi is my code: export excel using StateNAdataClean.xlsx, firstrow(variables) replace

      However, it still truncate long text responses. My strings are without less than 32 767 characters, even less than 500. Maybe the problem lays when I import the data into stata. I export the data as SPSS file from SurveyGizmo and then I convert the data into .dta in Stat/Transfer. I will take a look at this conversion closely.

      Comment


      • #4
        The problem was SPSS. They have a limit for the characters. I fixed the problem. Thanks

        Comment

        Working...
        X