Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Appending several excel data sets into one


From   "Allan Reese (Cefas)" <[email protected]>
To   "'Statalist \(E-mail\)" <[email protected]>
Subject   RE: st: Appending several excel data sets into one
Date   Mon, 17 Sep 2007 11:12:06 +0100

Couple of comments on original question "How can one append several Excel sheets in one stata data set in a simple program ..."

1. With great care!  Excel is so easy to use because it doesn't impose typing, and using multiple sheets just increases the problem.  Unless the sheets were very well supported by VBA and macros (about as common as Yeti or Loch Ness monster), you'll find that apparently similar variables are numeric in one file, strings (of varying lengths) in another, or a mixture of numbers with some strings that read into Stata as missing.  Dates are a nightmare.  My experience has been that Excel sheets have very little chance of doing a clean join.

2. If workbooks contain multiple sheets, you would like to access the sheet names.  Excel doesn't provide this facility, but an add-in called ASAP-utilities http://www.asap-utilities.com/ includes one to create an index sheet listing all sheets in the workbook.  We used this to write macros to copy data from multiple sheets within a book into one sheet for export.

Allan





© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index