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

st: RE: generate a string variable holding a double quote?


From   "David Harrison" <david.harrison@icnarc.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: generate a string variable holding a double quote?
Date   Thu, 19 May 2005 16:44:17 +0100

Compound double quotes must be used to enclose any string that contains quotes:

gen quote = `"""'

I can't speak for the what the data editor does (as I hardly touch it), although it does seem to have some strange behaviour if you try to enter quotes... I can't manage to enter a single " character in it.

David

-----Original Message-----
From: Sherman, Richard [mailto:RSherman@fsw.leidenuniv.nl]
Sent: 19 May 2005 16:25
To: statalist@hsphsun2.harvard.edu
Subject: st: generate a string variable holding a double quote?


Dear Statalist,

Is it possible to create a string variable containing only the character
" ?  Stata 8 won't let me do so with the command

gen quote = """

or in the data editor.

This would be convenient for, e.g, labeling variables with the values of
another variable.

Thanks,

Richard Sherman
Department of Political Science, Leiden University
Leiden, Netherlands
http://homepage.mac.com/richard.sherman/

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



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



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