Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Combined multiple PDF files using R Tool

AMathis
6 - Meteoroid

I am currently using the "R Tool" to read the data from a PDF (from a directory).  The problem I am having is I need this tool to read multiple PDF files.  I do not have access to the "PDF to Text" tool or that suite.  Does anyone know of a change in the below coding that could help?  Or any possible work around?

 

Coding:

#Read in the PDF file location which must
#be in a field called FullPath
data <- read.Alteryx("#1",mode="data.frame")

#Use pdf_text() funciton to return a character
#vector containing the text for each page of
#the PDF
txt <- pdftools::pdf_text(file.path(data$FullPath))

#Convert the text character vector to a data
#frame
df_txt <- data.frame(txt)

#output the data frame in stream 1
write.Alteryx(df_txt, 1)

 

Alteryx R Tool screenshot.JPG

1 REPLY 1
apathetichell
20 - Arcturus

I manage my R libraries in R Tools and can't speak to if there is a problem here - I would note that your FullPath is probably written like a PC full path ie (c:\...\) when R wants an R Path (ie c:\\..\\ or c:/../)

Labels
Top Solution Authors