Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: import excel data into STATA

From   Neil Shephard <>
Subject   Re: st: import excel data into STATA
Date   Fri, 15 Oct 2010 08:21:41 +0000

On Fri, Oct 15, 2010 at 5:35 AM, Kay Walker <> wrote:
> Hi samn,
> You should try to import the columns with text data separately from the
> rest.
> Set up the columns in Stata  ready to receive text, then simply copy and
> paste the text data into the new file.

This is a bad idea in my opinion.

1) Splitting data is pointless, it will (presumably) need to be
recombined again, you're making more work for yourself in splitting

2) Copying and pasting into the data editor is slow, laborious and not
conducive to automation (i.e. scripting in a do-file).  Next time the
data needs to be imported into Stata because the underlying data set
has changed you can't just run a script.

On Fri, Oct 15, 2010 at 12:38 AM, sun samn <> wrote:
> Hi, there,
>    I use 'odbc load' to import excel data. It works fine for double  variables(numbers), but not for string variable(letters). Basically when the variable is string, the observation is zero.

My experience of using -odbc-load- is to query databases.  I've never
used it to import M$-Excel files.

You don't tell us the _exact_ command you are using and the output
that Stata produces so its difficult for anyone to start trying to
work out why things aren't working as you expect them to.

My advice would be to save the M$-Excel file as an ASCII
comma-separated variable (*.csv) file and to then use -insheet- to
read the data into Stata.

Another alternative is to use StatTransfer to convert the M$-Excel
file to a Stata data file (see


"Our civilization would be pitifully immature without the intellectual
revolution led by Darwin" - Motoo Kimura, The Neutral Theory of
Molecular Evolution

Email -
Website -
Photos -

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index