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

Re: st: Getting text files with quotation marks into Stata

From   Steven Samuels <>
Subject   Re: st: Getting text files with quotation marks into Stata
Date   Fri, 7 Nov 2008 16:08:19 -0500

I get the same error. On a Mac (OS X 10.4.11) at least, the xml files are plain text files. The solution is to -infix- a single string variable with length equal to the maximum of the data lines Then use - regexm- to extract the pieces.

****************Code Begins************
infix str dummy 1-90 using dd.xml, clear
***************Code Ends**************

On Nov 7, 2008, at 2:51 PM, Dan Weitzenfeld wrote:

Hi Folks,
I'm trying to read .xml files into Stata.  Once there, I can parse
them, even if they are read into just one variable - I'm handy with
-regexm- and the like.
My problem is that I can't seem to get around the quotation marks in
the file.  Two rows of the file look like this:

  <session="NCX_1" target="entrance" movie="0" start="22:22:23.000"
duration="199" />
  <session="NCX_2" target="floor" movie="0" start="22:22:24.000"
duration="179" />

When I insheet, I get


When I xmluse, I get

unrecognizable XML doctype

regardless of which doctype I specify.

Are there any tricks for getting Stata to ignore the quotation marks
within the file?
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index