Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Problem with variable when importing data from Microsoft Excel


From   Joseph Monte <hmjc66@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Problem with variable when importing data from Microsoft Excel
Date   Tue, 6 Nov 2012 16:49:53 +0000

Dear Statalisters,

I am trying to import a Microsoft Excel file into Stata 12. I am
having a problem with one of the variables (var1) which has multiple
values for a given id.

If I save the file as a .csv, then use -insheet- and then

split var1, p(" ")

and then -reshape-

I get the following output for var1 for the given id, which is what I want.

var1
-
-
-
-
-
11.00
11.00
6.00

However, if I import the file into Stata using -import excel-, var1 is
displayed as
-----11.0011.006.00 (I don't know how to -split- on this since there
is no space or any other character in between values)

Is there any way I can get the desired output by using -import excel- ?

Any help/suggestions would be much appreciated.

Joe
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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