Skip to content
Prev 377855 / 398502 Next

Combine recursive lists in a single list or data frame and write it to file

Thanks again Jim. The links below are for 2 files (papers) i
downloaded from Google Scholar for testing. You can use either both or
any other pdf files with tables. Thanks again-EK.

https://pdfs.semanticscholar.org/50a4/2b8146f08161b1036457fe0d241b6b898974.pdf
https://pdfs.semanticscholar.org/50a4/2b8146f08161b1036457fe0d241b6b898974.pdf


The code:
install.packages("rJava")    ;library(rJava)
install.packages("tabulizer");library(tabulizer)
MyPath <- "C:/Users/name/Documents/Temp"
ExtTable <- function (Path,CalOrd){
  FileNames <- dir(Path, pattern =".(pdf|PDF)",full.names = TRUE)
  MyFiles <- lapply(FileNames, function(i) extract_tables(i,method
= "stream"))
  if(CalOrd == "Yes"){
    MyOFiles <- gsub("(\\s.*)|(.pdf|.PDF)","",basename(FileNames))
    MyOFiles <- match(MyOFiles,month.name)
    MyNFiles <- MyFiles[order(MyOFiles)]}
  else
    MyFiles
}
MyTables <- ExtTable(Path=MyPath,CalOrd = "Yes")
On Thu, Dec 20, 2018 at 12:28 AM Jim Lemon <drjimlemon at gmail.com> wrote: