What is the simplest way to convert a large Excel spreadsheet with multiple worksheets into .CSV files in R?
Note that I\'ve tested XLConnect and XLSX and found that m
Here's a loop to write out all sheets:
require(gdata)
## install support for xlsx files
installXLSXsupport()
excelFile <- ("/full/path/to/excelFile.xlsx")
## note that the perl scripts that gdata uses do not cope well will tilde expansion
## on *nix machines. So use the full path.
numSheets <- sheetCount(excelFile, verbose=TRUE)
for ( i in 1:numSheets) {
mySheet <- read.xls(excelFile, sheet=i)
write.csv(mySheet, file=paste(i, "csv", sep="."), row.names=FALSE)
}