[R] Help for pdf conversion

Thomas Subia t@ub|@ @end|ng |rom |mgprec|@|on@com
Thu Oct 31 01:06:22 CET 2019


I'm trying to convert a pdf to a text file with the following code.

# pdf to excel
library(pdftools) # pdf to excel library
# set working directory
# input pdf
txt <- pdf_text("C:/Users/10619.pdf")
write.table(cat(txt[1]),file="10619.txt",sep= "\t",row.names =TRUE,col.names =FALSE)

When I examine the contents of cat(txt[1]) on the console, everything I need is displayed in the format I need.

However when I execute write.table(cat(txt[1]),file="10619.txt",sep= "\t",row.names =TRUE,col.names =FALSE) and examine the output, my output does not match cat(txt[1]).
I suspect that sep= "\t",row.names =TRUE,col.names =FALSE) might be the error.

How can one output the contents of cat(txt[1]) and retain its format?

Thomas Subia

	[[alternative HTML version deleted]]

More information about the R-help mailing list