Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. library(pdftools)
  2.  
  3. x <- pdf_text("Test.pdf)
  4. y1 <- str_split(x, "r")
  5.  
  6. #pdf output contains a total of 7 lists
  7.  
  8. a <- y1 [[4]]
  9. b <- c(a[4],a[11:13]) #Obtain only rows 4, 11 to 13 from list 4
  10.  
  11. n2 <- y1[[3]]
  12. n3 <- c(n2[3]) #Obtain only rows 3 from list 3
  13.  
  14. n <- y1[[5]]
  15. n1 <- c(n[3]) #Obtain only rows 3 from list 5
  16.  
  17. c <- y1[[6]]
  18. d <- c(c[4:18]) #Obtain only rows 4 to 18 from list 6
  19.  
  20. e <- c(n3,b,d,n1) #Combining all necessary information into one list
  21.  
  22. z <- substr(s[1:21], start = 15, stop = 200) #to remove white spaces between quotes
  23.  
  24. Name <- z[1]
  25. InterestedParty <- z[2]
  26. TotalOwnBefore <- substr(z[11], start = 97, stop = 120)
  27. Ownership <- list(NM = Name, Party = InterestedParty, OwnBefore = TotalOwnBefore)
  28.  
  29. write.csv(Ownership, file="MyData.csv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement