Statalist


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

Re: st: space trouble in excel to stata conversion


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: space trouble in excel to stata conversion
Date   Fri, 03 Oct 2008 11:54:02 +0100

Ashim Kapoor wrote:
> Hey I have to add something.
>
> This time I use the data file in excel, save it as xml , now I copy
> and paste from XML to Stata and VOILA! the annoying spaces are GONE!!!
>
> Any tips / words of wisdom ?
>
>   
Perhaps trying out some of the suggestions that others have made such as...
>>> On Wed, Oct 1, 2008 at 7:31 PM, Johannes Geyer <[email protected]> wrote:
>>>       
>>>>> That is a solution for Stata->Excel, but Ashim asked about Excel->Stata.
>>>>>           
>>>> I
>>>>         
>>>>> tried to replicate his problem, and it did not happen to me... Anything
>>>>> special about that string variable that we should know about, Ashim?
>>>>>           
>>>> Have
>>>>         
>>>>> you tried to -insheet- instead of pasting?
>>>>>           

I too would highly recommend using -insheet- to read your Excel file. 
You need to save it as an ASCII text-file and the easiest format from
within Excel is to save it as a Comma-Separated Variables file (file
extension *.csv).  Then you can -insheet using [your filename], clear
comma- and you shouldn't have the 'annoying spaces'.

Another alternative would be to use Stat/Transfer (see
http://www.stattransfer.com/html/products.html  ), but the -insheet-
approach is very simple and will (should) work.

Neil

-- 
"We should make things as simple as possible, but not simpler" - Anon (not Albert Einstein)


***********************************************************************
This  message  may  contain  confidential and  privileged  information.
If you  are not the  intended recipient  you should not  disclose, copy
or distribute information in this e-mail or take any action in reliance
on its contents.  To do so is strictly  prohibited and may be unlawful.
Please  inform  the  sender that  this  message has  gone astray before
deleting it.  Thank you.

2008 marks the 60th anniversary of the NHS.  It's an opportunity to pay
tribute to the NHS staff and volunteers who help shape the service, and
celebrate their achievements.

If you work for the NHS  and  would like  an NHSmail  email account, go
to: www.connectingforhealth.nhs.uk/nhsmail
***********************************************************************

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index