title: How to convert a PDF listing the worlds ministers and cabinet members by country to a .csv in R
body: <p>The CIA publishes a list of world leaders and cabinet ministers for all countries multiple times a year. This information is in PDF form. </p>
  
  <p>I want to convert this PDF to CSV using R and then seperate and tidy the data. </p>
  
  <p>I am getting the PDF from "<a href="https://www.cia.gov/library/publications/resources/world-leaders-1/" rel="nofollow noreferrer">https://www.cia.gov/library/publications/resources/world-leaders-1/</a>"
  under the link 'PDF Version for Prior Years' located at the center right hand side of the page. </p>
  
  <p>Each PDF has some introductory pages and then lists the Leaders and Ministers for each country. 
  With each'Title' and 'Name' being seperated by a '..........' of varying lengths. </p>
  
  <p>I have tried to use the pdftools package to convert from PDF, but I am not quite sure how to deal with the format of the data for sorting and tidying. </p>
  
  <p>Here is the first steps I have taken with a downloaded PDF</p>
  
  <pre><code>library(pdftools)
  
  
  text &lt;- pdf_text("Data/April2006ChiefsDirectory.pdf")
  test &lt;- as.data.frame(text)
  </code></pre>
  
  <p>Starting with a single PDF, I want to list each Minister in a seperate row, with individual columns for year, country, title and name. </p>
  
  <p>With the step I have taken so far, converting the PDF into .csv without any additional tidying, the data is in a single column and each row has a string of text contining title and name for multiple countries.</p>
  
  <p>I am a novice at data tidying any help would be much appreciated.</p>