r - Getting error message when loading an .xlsx file? -


i not sure why happening. trying load 180 .xlsx files using xlsx package. have run though code thought load files (different names same format) , extract 3 rows each file. see below:

f <- list.files("./")   dat = lapply(f, function(i){      x = read.xlsx(i, sheetindex=1, sheetname=null, startrow=127,      endrow=130, as.data.frame=true, header=t)  # may want add column file they're       x$file =  # return data       x      }) 

i following error

error in .jcall("rjavatools", "ljava/lang/object;", "invokemethod", cl, : java.lang.illegalargumentexception: inputstream neither ole2 stream, nor ooxml stream

i have updated java on mac didnt work.

any suggestions anyone?

anoop

the file trying read may not xlsx file .. got same error when reading file of xlsx format. when tried read same file read.csv(), worked . shows file trying read not in xlsx format.


Comments