aboutsummaryrefslogtreecommitdiffstats
path: root/R/xmltotab.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/xmltotab.R')
-rw-r--r--R/xmltotab.R13
1 files changed, 13 insertions, 0 deletions
diff --git a/R/xmltotab.R b/R/xmltotab.R
new file mode 100644
index 00000000..9bec6d0b
--- /dev/null
+++ b/R/xmltotab.R
@@ -0,0 +1,13 @@
+## example to convert an Excel xml file to tab delimited
+
+input <- xmlToList("grid1_1cz1rlvt.xml")
+for(row in input$Worksheet$Table){
+ line <- c()
+ for(cell in row){
+ if("Data" %in% names(cell)){
+ line <- c(line, cell$Data$text)
+ }
+ }
+ cat(paste(line, collapse="\t"), "\n", file="output.csv", append=TRUE)
+}
+