Announcement

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

  • Copy and Paste from Data Editor

    Hello,

    I'm having trouble with this in theory relatively simple task!

    I copy a string variable from Stata data editor, containing 924093 rows of data.
    When I paste it into Excel there are only 923471 rows of data on my spreadsheet.

    Would appreciate some help please, cant find anything via Google.

    Thanks

  • #2
    For some (older) versions of Excel, I think that the maximum number of rows allowed. I did try an example, with a 20 character string variable, and it worked ok in my Excel version 1908. My recollection, though, is that Excel versions using the .xls file format, as opposed to the .xlsx, won't accommodate that many rows.

    Regardless, cutting and pasting as a way to transfer data is a practice widely deprecated by experienced data workers. It does not leave an audit trail, mistakes can happen "invisibly," and it's not part of reproducible routine. Instead, use -export excel- (File/Export/Data to Excel etc.) to create a spreadsheet with your variable in it, and bring that file into Excel. While that procedure might seem inconvenient, it's a good habit whose minor inconvenience pays off in certainty.
    Code:
    export excel MyVariable using "myfile.xlsx"

    Comment


    • #3
      Thanks Mike. Some but not all of the strings had " on them eg. "The Sky is Blue", and for whatever reason they weren't being copied. I ran a replace command on this variable to remove them, and that solved the issue. Take your point on exporting, it just takes so much longer though. Usually copy/paste works fine for my needs. Thanks again.

      Comment

      Working...
      X