Statalist


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

st: RE: RE: Importing data from excel with multiple worksheets


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Importing data from excel with multiple worksheets
Date   Fri, 23 May 2008 09:13:48 -0700

I have had a similar problem periodically:  some well-meaning scientist
creates a data file in excel with the first set of data in rows 1-20,
say with row 1 having some descriptor of the lab data, row 2 having
variable names and rows 3 to 20 having the variable values.
They then skip a few rows and rows 25 to 50 have another set of data,
perhaps from a second hospital with more description in rows 25 & 26 and
then variable names in row 27 (often the same as in row 2), and data in
rows 28 to 50.
This goes on for 10 or 12 data sets, all related, but the text manages
to mess up any ability to read in the data.  The brute force method will
split the data into subsets and save them, followed by data entry and
possible merging.  
Is there an easier, more efficient way to do this?

I should mention I don't have the issue at present, but it has been a
pain in the neck in the past.

Perhaps the most efficient way is to tell the person who created the
files to enter the data properly and come back, but this doesn't gain
many happy faces...

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss
Sent: Friday, May 23, 2008 8:48 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: Importing data from excel with multiple worksheets

Try -xmluse- which allows specification of a specific worksheet. Hold
the
data in -tempfile-s and later append them one after another.

Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Rijo John
Sent: Friday, May 23, 2008 5:23 PM
To: stata
Subject: st: Importing data from excel with multiple worksheets

HI,

I have  an excel file with many worksheets all of which contains same
set of variables but representing different states. Instead of copying
and pasting all of them one by one into stata and later stacking
different stata files, is there an easier way to stack all the excel
sheets into one data and export it to stata?

Thanks,
Rijo.
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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