Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Compound double quote


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Compound double quote
Date   Mon, 20 Aug 2012 16:56:50 +0100

The first token of

"AMC Concord", 2, 4

even when parsing on commas is reported as

AMC Concord

as Stata's tendency is to strip " " as delimiters at each level of
parsing. To insist that " " are included as part of the token, I think
you need to start with

local line `" `""AMC Concord""', 2, 4 "'
tokenize `"`line'"', parse(",")
di `"`1'"'

Appropriate thanks would to be stop misspelling "Thanks" !

Nick

On Mon, Aug 20, 2012 at 4:34 PM, tashi lama <ltashi32@hotmail.com> wrote:
>
>    Could someone help me with the following
>
> local line "AMC Concord", 2, 4
> tokenize `"`line'"', parse(",")
> di `"`1'"'
> AMC Concord  (I was hoping to get "AMC Concord" with double quotation). Any idea?
*
*   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   |   Site index