Skip to content

Commit

Permalink
app update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Rinker committed Sep 27, 2018
1 parent 85b152c commit da6c381
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion inst/extract_text_app/app/extract_text.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,19 @@ mydata <- reactive({

req(input$file_input)
in_file <- input$file_input
dplyr::data_frame(text = textreadr::read_document(in_file$datapath))

ext <- tools::file_ext(in_file$datapath)

switch(ext,
pdf = {textreadr::read_pdf(in_file$datapath)},
doc = {textreadr::read_doc(in_file$datapath)},
docx = {textreadr::read_docx(in_file$datapath)},
rtf = {textreadr::read_rtf(in_file$datapath)},
html = {textreadr::read_html(in_file$datapath)},
stop("file type unsupported")
) %>%
dplyr::as_tibble()

})
```

Expand Down

0 comments on commit da6c381

Please sign in to comment.