在R中将PDF转换为txt [英] PDF to txt in R

查看:126
本文介绍了在R中将PDF转换为txt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用pdftotxt将pdf转换为txt.不断收到错误消息.希望获得帮助:

I'm trying to convert a pdf to txt using pdftotxt. Keep getting an error. Would appreciate help:

dest <- getwd()

# make a vector of PDF file names
myfiles <- list.files(path = dest, pattern = "pdf",  full.names = TRUE)


lapply(myfiles, function(i) system(paste('"C:/Users/Karan       Tibrewal/Downloads/xpdfbin-win-3.04.zip/xpdfbin-win-3.04/bin32/pdftotxt.exe"', 
                                     paste0('"', i, '"')), wait = FALSE) )

我收到此警告:

警告信息: 运行命令'"C:/Users/Karan Tibrewal/Downloads/xpdfbin-win-3.04.zip/xpdfbin-win-3.04/bin64/pdftotxt.exe""C:/Users/Karan Tibrewal/Documents/cem/12_13.pdf '的状态为127

Warning message: running command '"C:/Users/Karan Tibrewal/Downloads/xpdfbin-win-3.04.zip/xpdfbin-win-3.04/bin64/pdftotxt.exe" "C:/Users/Karan Tibrewal/Documents/cem/12_13.pdf"' had status 127

我找不到txt文件.怎么了?

I can't find the txt file. Whats wrong?

推荐答案

我认为当路径中有空格时,您需要使用分隔符.类似于"\"而不是\?在Karan和Tibrewel之间?

I think you need a separator when there is a space in the path. Something like "\" instead of \ ? between Karan and Tibrewel?

这篇关于在R中将PDF转换为txt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆