Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Problem with embedded quotes in strings when using insheet

From   Chris Ruebeck <[email protected]>
To   [email protected]
Subject   st: Re: Problem with embedded quotes in strings when using insheet
Date   Wed, 30 Mar 2005 23:35:31 -0500

There may be a way to get Excel to stop producing the double quotes. But it might not work with tab-delimited files.

I've always resorted to a good text editor's find-and-replace after the save from Excel and before using insheet in Stata. For example, search on tab-quote-quote and replace with tab. For an editor, use something like TextPad if you're on a PC, a derivative of Alpha on the Mac (and Linux?), or a derivative of Emacs anywhere.

Asking Stata to figure out the quote characters will probably be far too much work.


On Mar 30, 2005, at 9:30 PM, David E Moore wrote:

I write out a portion of the data currently held in memory, including some
string variable values, using -outsheet-. Some of the strings have double
quotes (not always balanced) embedded in them. (I know, I shouldn't have
allowed this in the first place.) When I -outsheet- the data it looks perfectly
fine and I can read it into Excel just fine. Now, I want to append more data to
that file, so I -insheet- the original, append the new data, and -outsheet-
again. When I -insheet- the data, the embedded quotes confuse the heck out of
the -insheet- parser and the data are no longer fine. I can provide details on
what happens, but that isn't really relevant.
*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index