I want to convert 100 excel document lying in "C:/Users/hp/Desktop/excel" to .txt format..I am triyng to use lapply so that all of them are converted to txt at one go.. Please help me .. if I have one file I am converting the .xlsx document to txt in the following way library(xlsx)
sink("output.txt")
data=read.xlsx("C:/Users/hp/Desktop/excel/test2.xlsx",1)
data
sink()
I am writing following code to do it recursively
dest <- "C:/Users/hp/Desktop/excel"
dir(dest)
myfiles <- list.files(path = dest, pattern = "xlsx", full.names = TRUE)
lapply(myfiles,function(x) system(sink(x) data=read.xlsx(myfiles,1) data
sink()),fullnames=TRUE)
After having done for .xlsx it has to be done for .docx also