Bookmark and Share

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


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

RE: Re: st: Import of Excel files some files are formatted as ¨strings¨ how to change that??


From   Lars Sorensen <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: Re: st: Import of Excel files some files are formatted as ¨strings¨ how to change that??
Date   Sat, 29 Oct 2011 03:20:51 +0000

Hi everybody

It worked out perfectly. Thanks a lot for your help its perfect

Regards
Lars 
________________________________________
From: [email protected] [[email protected]] on behalf of Phil Clayton [[email protected]]
Sent: Friday, October 28, 2011 10:55 PM
To: [email protected]
Subject: st: Re: st: Import of Excel files some files are formatted as ¨strings¨ how to change that??

Hello and welcome to Stata (nb not STATA)!

Firstly, make sure you have the latest version - there have been some updates since version 12 was released that have improved importing from Excel, including a problem where numeric cells were sometimes imported as strings. You can check for an update by running:
update query

If that doesn't help, to convert numbers in string format to numeric format, the command you're after is -destring- (use -help destring- to read about it, or you can access it via the menu Data -> Create or change data -> Other variable-transformation commands -> Convert variables from string to numeric)

The Stata documentation is very good; you could for example answer this question by typing:
search convert string

Also take a look at chapter 23 of the User's Guide, and of course all of the rest of the User's Guide too (!)

Phil

On 29/10/2011, at 1:37 PM, Lars Sorensen wrote:

> Hi Statalist
>
> Probably a simple question.
>
> I am quite new to STATA and have just bought the 12. version to MAC. I am very satisfied with the program but have encountered some technical issues when I import Excel files to the program. Some of the columns are imported as ¨strings¨which result in the numbers being red and I cant use them in the analysis. Does anyone know how to convert this format to the ordinary format or how to prevent that some of the data is imported as strings ??
>
> Hope you can help me
>
> Kind Regards
>
> Lars Lindholm Sorensen M.D.
> Post. Doct. Fellow
> Dept. of Cardiology
> Johns Hopkins University
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


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

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


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