我想从一堆PDF中提取某些数字信息.下面显示了一个示例,其中数字信息位于相应的标题下.
与上述图像(pdftools::pdf_text()
读入)对应的字符串为:
mystr <- ' Natural Dry\n Metric Tons @ Moisture or Metric Tons\n B.L. WEIGHT: 78,944 1.70% 77,601.952\n'
有很多空格和换行符.有可能提取这些标题下的信息吗?
我期望的最终结果是:
myresult <- tibble(
`Natural Metric Tons` = 78944,
Moisture = 1.7,
`Dry Metric Tons` = 77601.952
)