[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: RE: problem referencing certain characters
Thanks for your suggestions.
The quote characters work fine for me too in that same context, but for
some reason, within my dofile the exact same code produces the r(612)
error, "unexpected end of file."
replace `var' = subinstr(`var',`"""',"",.);
That peice of code is in a series of replace commands within a for loop.
when i comment out that single line it works fine...otherwise i get that
Its inexplicable to me, probably tough to debug on your end too unless
youve had this exact problem before.
<firstname.lastname@example.org To: <email@example.com>
Sent by: Subject: st: RE: problem referencing certain
11/21/2002 04:51 PM
Please respond to
> -----Original Message-----
> From: Kyle.Lewis@ny.frb.org [mailto:Kyle.Lewis@ny.frb.org]
> Sent: Thursday, November 21, 2002 4:30 PM
> To: firstname.lastname@example.org
> Subject: st: problem referencing certain characters
> I am writing a program to clean up some data and I wish to
> delete certain
> characters from my data. I have been using the subinstr
> command with the
> following syntax:
> replace `var' = subinstr(`var',"(removed character)","",.);
> This works exactly as I intend, except for the double quotes
> character (")
> and the question mark (?). I referenced the stata manual and
> although the
> issue is addressed, their solution does not seem to work for
> me. They say
> to use the compound double quotes (`" "'). But doing so makes no
> difference for me. Stata still is unable to correctly read
> the following
> replace `var' = subinstr(`var',`"""',"",.);
> replace `var' = subinstr(`var',"?","",.);
> I have no idea why it wont work for the question mark either.
> If anyone has experienced similar problems or knows of a
> solution, please
> Thank you,
I don't have any trouble with the quote characters:
. set obs 1
obs was 0, now 1
. gen str10 junk=`"abc"abc"'
. gen str20 j2=subinstr(junk,`"""',"",.)
1. abc"abc abcabc
* For searches and help try: