[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Problem with embedded quotes in strings when using insheet
One option is to save a second copy of your data in Stata format to
avoid the -insheet- step. Another option is to use Stat/Transfer in
combination with -stcmd- to convert data from Stata to Excel format
--- David E Moore <email@example.com> wrote:
> I didn't notice this little "undocumented feature" in the faq for
> reading Excel
> data, so I thought I'd see if anyone has a workaround. Just so you
> know, I'm
> leaning toward -file- to "solve" the problem, but it's quite a lot
> more work
> than -insheet- ....
> Here's the situation:
> I write out a portion of the data currently held in memory,
> including some
> string variable values, using -outsheet-. Some of the strings have
> 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
> 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.
> I use "tab" as my delimiter when writing and reading the file, so
> I'm not
> exactly sure why Stata thinks it should be looking at quotes in the
> first place
> (hence, undocumented feature), but that's the way it is.
> My question is:
> Does anyone see or know a fairly efficient way around this problem
> (i.e., to
> read embedded quotes properly)? Right now, I'm trying to read in
> each line of
> the tab delimited file and parse it myself. That's okay, but it
> makes for some
> rather ugly programming and amounts to writing my own -insheet-
> Thanks for any suggestions.
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
* For searches and help try: