library(XML) d1 <- "C:\\Users\\Administrator\\Documents\\file.xml" doc1 <- xmlParse(d1) Data <- xmlToDataFrame(nodes=getNodeSet(doc1,"//Column1"))[c("Column2","Column3","Column4","Column5","Column6")]
谢谢
library(XML) d1 <- "C:\\Users\\Administrator\\Documents\\file.xml" doc1 <- xmlParse(d1) Data <- xmlToDataFrame(nodes=getNodeSet(doc1,"//Column1"))[c("Column2","Column3","Column4","Column5","Column6")]
谢谢
setwd("E:/xxx/SplitFIles/") files <- list.files() parse_xml <-function(FileName) { doc1 <- xmlParse(FileName) doc <- xmlToDataFrame(nodes=getNodeSet(doc1,"Column4","Column6")] } Data <- ldply(files,parse_xml)