title: Read multiple pdf files at once and extract sentences that contain a keyword using R
body: <p>Let's assume that I have few pdf files stored in a directory and I want to read all those pdf files at one and extract all the sentences that contain a specific keyword (in this case 'provisions') instead of manually opening each file and looking for that keyword.</p>
  
  <p>I have tried reading the files but how can I make R go through each pdf file to search for that keyword and output those sentences?
  Here's a small piece that I have written:</p>
  
  <pre><code>library(pdftools)
  files &lt;- list.files("filepath",pattern = "pdf$", full.names = TRUE)
  comb &lt;- lapply(files, pdf_text)
  </code></pre>
  
  <p>For file reference purpose, the links for pdf files are:</p>
  
  <pre><code>&lt;https://www.supremecourt.gov/opinions/14pdf/13-1314_3ea4.pdf&gt; 
  &lt;https://www.supremecourt.gov/opinions/14pdf/14-7955_aplc.pdf&gt;
  &lt;https://www.supremecourt.gov/opinions/14pdf/14-46_bqmc.pdf&gt;
  </code></pre>
  
  <p>I have created a directory and saved the pdf files in it. </p>