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

st: Re: problem with embedded quotes in strings


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: problem with embedded quotes in strings
Date   Wed, 22 Jun 2005 09:22:08 -0400

I'm not fully convinced that this sort of thing is impossible in Stata pre version 9 (although it is probably much more elegantly and efficiently done as you have, in Mata). If you construct a tab-delimited file such as

1 john's string 999
2 mary's string 998
3 nick's "Ole Nick" string 997

and apply the program ltype, which appears in Stata 8.x -help file-, it handles the embedded single and double quotes successfully:

. ltype test.raw
1 1 john's string 999
2 2 mary's string 998
3 3 nick's "Ole Nick" string 997

Since macros may be very long indeed (even in Stata 8.x) the limit on length is not really binding.

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

On Jun 22, 2005, at 2:33 AM, David wrote:


Those who have written ado
programs will note that nearly everything I accomplished could have been done in
Stata if not for the built-in limit on string length and/or (mis)handling of
quotes. It is unfortunate that it took Mata to do this, because it is not
available to anyone using an older release of Stata. On the other hand, as a C
programmer, I can't recommend Mata enough. It's actually better than sliced
bread....

D. Moore
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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