Statalist


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

Re: st: space trouble in excel to stata conversion


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: space trouble in excel to stata conversion
Date   Fri, 3 Oct 2008 12:41:55 +0200

Excel is usually frowned upon on the list, but try http://www.asap-utilities.com/index.php which is a brilliant add-in for Excel and let`s you clean up data fast, before you even paste to Stata.

HTH
Martin
_______________________
----- Original Message ----- From: "Ashim Kapoor" <ashimkapoor@gmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Friday, October 03, 2008 12:39 PM
Subject: Re: st: space trouble in excel to stata conversion



Hello,

I posted about this a couple of days ago.

Let me tell you my problem. I have a string variable , sometimes at
the end of many observations I seem to have an extra space character
which does not go away when I use trim.

Also I have tried adding a " dummy" to all the observations and then
doing an itrim. But some observations continue to have 2 spaces
between the 2nd last and last word. Nothing seems to be working!

Any tips ?

Thank you,
Ashim.

On Wed, Oct 1, 2008 at 7:53 PM, Ashim Kapoor <ashimkapoor@gmail.com> wrote:

Thank you. I will try that and get back to you.

Ashim.

On Wed, Oct 1, 2008 at 7:31 PM, Johannes Geyer <JGeyer@diw.de> 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?

Right! I missed that. I would try - insheet- as Martin uggests; -odbc-
may also help

h odbc

Johannes






-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Johannes
Geyer
Sent: Wednesday, October 01, 2008 3:41 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: space trouble in excel to stata conversion

"here is what I do, I copy and paste a string variable from excel to
stata ( ie. a column of observations from excel to stata). For some
strange reason there is a SPACE after each observation which refuses
to go away even after I use the -trim- command.
Has anyone experienced this ? Please tell me if I can read about this
somewhere."

I don't know - you could do the following and avoid that problem:

*********************
sysuse auto
xmlsave make using FILENAME, replace doctype(excel)
*********************

Johannes




----------------------
Johannes Geyer
Deutsches Institut für Wirtschaftsforschung (DIW Berlin)
German Institute for Economic Research
Department of Public Economics
DIW Berlin
Mohrenstraße 58
10117 Berlin
Tel: +49-30-89789-258





*
*   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/


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