在R中将PDF转换为txt [英] PDF to txt in R
问题描述
我正在尝试使用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屋!