Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Peter Dalgaard
Ulrich Keller [EMAIL PROTECTED] writes: I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes repeated like this: tagvalue1/tagtagvalue2/tagsome

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Marc Schwartz
On Sat, 2007-02-24 at 15:03 +0100, Peter Dalgaard wrote: Ulrich Keller [EMAIL PROTECTED] writes: I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Charilaos Skiadas
All these methods do assume that you don't have nested tag's, like so: tagtagfoo/taguseful stuff/tagsome garbage/tag For that you would really need a true parser. So I would double-check to make sure this doesn't happen. Do you have any control on where those XML files are generated though?

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Gabor Grothendieck
The _question_ assumed that, which is why the answers did too. On 2/24/07, Charilaos Skiadas [EMAIL PROTECTED] wrote: All these methods do assume that you don't have nested tag's, like so: tagtagfoo/taguseful stuff/tagsome garbage/tag For that you would really need a true parser. So I would

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Charilaos Skiadas
On Feb 24, 2007, at 11:37 AM, Gabor Grothendieck wrote: The _question_ assumed that, which is why the answers did too. Oh yes, I totally agree, the file snippet the OP provided did indeed assume that, though nothing in the text of his question did, so I wasn't entirely clear whether the

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Jeffrey Horner
Charilaos Skiadas wrote: On Feb 24, 2007, at 11:37 AM, Gabor Grothendieck wrote: The _question_ assumed that, which is why the answers did too. Oh yes, I totally agree, the file snippet the OP provided did indeed assume that, though nothing in the text of his question did, so I wasn't