aboutsummaryrefslogtreecommitdiffstats
path: root/R/xmltotab.R
blob: 675132a7b1e49094095ce608d59b587af2829219 (plain)
1
2
3
4
5
6
7
8
9
10
## example to convert an Excel xml file to tab delimited
library(XML)
input <- xmlParse("/home/share/guillaume/grid1_1cz1rlvt.xml")
top <- xmlRoot(input)
table <- top[["Worksheet"]][["Table"]]
for(row in 1:xmlSize(table)){
    cat(paste(xmlSApply(table[[row]], xmlValue), collapse="\t"), "\n", file="output.csv", append=TRUE)
}