Displaying 2 results from an estimated 2 matches for "charstream".
2008 Jun 19
2
Pattern Matching Replacement
...;tag1 id=\"F2\"></tag1>\r\n<tag2></tag2></XML>"
Tried with sub(below) but it only replaces the first instance and I am not
sure how to pattern match so that it only replaces \r\n that exist within
tags(< and >).
sub("\r\n", "", charStream)
--
View this message in context: http://www.nabble.com/Pattern-Matching-Replacement-tp18014978p18014978.html
Sent from the R help mailing list archive at Nabble.com.
2008 Jun 25
0
Memory allocation failed: Copying Node
...tes <- c("&\r\nquot;",
"&q\r\nuot;","&qu\r\not;","&quo\r\nt;",""\r\n;")
amp <- c("&\r\namp;", "&a\r\nmp;","&am\r\np;","&\r\n;")
xmlDoc<-NULL
charStream <- readChar(filename, file.info(filename)$size)
charStreamNew <- gsubfn("<[^>]*>", ~ gsub("[\r\n]", "", x), charStream)
for(k in quotes) {
if(length(grep(k, charStreamNew)) > 0) {
charStreamNew <- sub(k, "&am...