r - Merging PDF easily with pdftools
问题描述
I'm doing several webscraping which returns daily pdf's in some directory (path) I need to find someway to get all files in as easy way. For now I'm listing all the files one by one. Is there an easy way to do it?
data_download
pdf_01 <- paste("path\\", data_download, " - MK - Debêntures novas.pdf", sep="")
pdf_02 <- paste("path\\", data_download, " - MK - Fundos novos.pdf", sep="")
pdf_03 <- paste("path\\", data_download, " - News - Instruções CVM.pdf", sep="")
pdf_04 <- paste("path\\", data_download, " - News - Notícias CVM.pdf", sep="")
pdf_merged <- paste("path\\", data_download, " - Novidades de hoje.pdf", sep="")
pdf_combine(c(pdf_01,pdf_02,pdf_03,pdf_04) ,output = pdf_merged)
解决方案
The function list.files()
gets you most of the way to what you want, if you want all the files in your path folder that contain "pdf" in the name to be merged, you could do something like:
pdf_combine(list.files(path, pattern="pdf", full.names=TRUE), output = pdf_merged)
推荐阅读
- javascript - 在将输入保存到数据库之前如何检查密码是否与确认的密码相同(猫鼬+快递+验证器)
- javascript - Discord.Js TypeError:无法读取未定义的属性“地图”
- mysql - 索引正在处理一个列,但不能处理同一表的另一列 iN mysql PHPMYADMIN
- java - Android:getRotationMatrix() 和 getInclination() 方法返回的“磁倾角”究竟是什么?
- qt - 在运行 Qt App 之前,在 Raspberry Pi 启动时运行启动画面
- g++ - C++ 错误消息:致命错误:wchar.h:没有这样的文件或目录
- php - 如何根据虚拟列过滤 Eloquent 查询?
- java - 使用 Java 和 selenium webdriver 和黄瓜框架进行 gmail 登录的 SnapDeal 自动化
- flutter - 为什么颤动的“返回顶部按钮”不起作用
- html - 为什么最后一个表格行不遵循 text-align center CSS?