如何使用Apache POI从PDF中提取原始文本?(How can I extract raw text from PDFs using Apache POI?)
我需要从几个文件中提取原始文本,其中一些是PDF,其中一些是DOC文件格式。
我必须使用Apache POI来做到这一点。 现在,我在处理word文件(提取和写入等)时发现了很多文档,但是我无法找到有关从PDF中提取的任何文档。
我认为Apache POI具备此功能是错误的吗?
如果是这样,有人可以推荐类似的Java程序,允许从多种文件格式中提取文本吗?
如果没有,任何人都可以指向我应该看到的文档和/或类/方法吗?
预先感谢您的任何帮助。
I need to extract raw text from several files, some of which are PDF and some of which are DOC file formats.
I have to use Apache POI to do this. Now, there is a lot of documentation I have found on dealing with word files (extracting and writing to etc.) but I am unable to find any documentation on extracting from a PDF.
Am I wrong in believing that Apache POI has this capability?
If so, can anyone recommend similar Java programs that allow text extraction from multiple file formats?
If not, can anyone point me to the documentation and/or the classes/methods that I should be looking at to do this?
Thank you in advance for any help.
原文:https://stackoverflow.com/questions/16910731
最满意答案
当
INPUT
或SET
语句读取文件结尾时,大多数SAS数据步骤实际上停止。我怀疑你的输入文件是空的或没有足够的数据来满足你的INPUT语句。
Most SAS data steps actually stop when the
INPUT
orSET
statement reads past the end of the file.I suspect that your input file is either empty or does not have enough data to satisfy your INPUT statement.
相关问答
更多-
什么是SAS认证[2023-02-23]
SAS是Statistical Analysis System的简称,是一款功能强大的统计分析软件。SAS认证相当于一种证书考试,可以向当地SAS代理机构咨询 -
什么是 nl sas[2023-05-10]
SAS,NL-SAS,SATA硬盘的区别 NL-SAS的是采用SAS的磁盘接口和SATA的盘体的综合体。换句话,Near Line (NL) SAS是带有SAS接口的“企业级SATA驱动器”。 SAS是串行scsi,SATA是串行ATA。 SAS 向下兼容SATA SCSI硬盘一般在10Krpm 或15krpm,而ATA硬盘在7.2Krpm 左右。 最初的SAS标准提供了300MB/s(SAS1.0),并计划推出的下一代SAS规范中,速度已经提高到了600MB/s(SAS2.0),SAS被期望最终能够达到1 ... -
34 %let progname=SAS Program Name.sas; 35 data _null_; 36 LL=input(getoption('linesize'),f8.); 37 put @; 38 _file_ = repeat('=',ll-1); 39 put; 40 progname=translate("&progname",'ff'x,' ...
-
SAS中的自动导入(Automated Imports in SAS)[2023-03-19]
执行导入的工作可能是一个读取文件的简短SAS程序。如果您正在使用它来管理一般流程(对于我想象的服务器),您确实会在EG中管理它。 您可以使用导入向导,编写PROC IMPORT语句,如: proc import file="whatever.csv" out=dsetname dbms=csv replace; run; 如果它是CSV,或者如果它不是分隔文件(或者,即使它是),则写入数据步骤: data dsetname; infile "whatever.txt"; input @1 varname ... -
当INPUT或SET语句读取文件结尾时,大多数SAS数据步骤实际上停止。 我怀疑你的输入文件是空的或没有足够的数据来满足你的INPUT语句。 Most SAS data steps actually stop when the INPUT or SET statement reads past the end of the file. I suspect that your input file is either empty or does not have enough data to satisfy ...
-
将SAS报告迁移到SSRS中(Migrating SAS Reports Into SSRS)[2022-09-09]
您需要查看数据源和报告输出,并确定在SQL和SSRS中从头开始手动重新创建报告所需的内容。 没有可用的转换工具。 You will need to look at the data sources and the report outputs and figure out what is required to manually recreate the reports from scratch in SQL and SSRS. There is no conversion tool available. -
SAS程序,用于检测是否在SAS base或SAS EG中运行(SAS program that detects if it runs in SAS base or SAS EG)[2023-04-26]
您可以使用全局宏变量_CLIENTAPP来测试您是否在EG中。 当你使用例如: data _null_; %put &_CLIENTAPP; run; 在EG 5.1中,它返回“SAS Enterprise Guide”。 _CLIENTVERSION为我的环境返回EG版本,eG:'5.100.0.15040' 不确定这些全局变量是否存在于Base中(目前无法对此进行测试),但如果它不起作用,您可以假设类似于变量不存在的基础,eG: if " &_CLIENTAPP" = 'SAS Enterp ... -
基本上,这是SAS数据步骤和SQL处理各自的连接/合并的方式不同的结果。 SQL为每个可能的键组合创建一个单独的记录。 这是笛卡尔积(在关键层面)。 然而,SAS数据步骤的流程合并方式却截然不同。 MERGE只不过是SET一个特例。 它仍然迭代地处理行,一次一个 - 它永远不会返回,并且一次从PDV中的任何数据集永远不会有多行。 因此,它无法在正常过程中创建笛卡尔积 - 这需要随机访问,SAS datastep不能正常执行。 它能做什么: For each unique BY value Take th ...
-
SAS中的Logistic回归(Logistic Regression in SAS)[2022-12-14]
基于这个SAS文档 (google“sas proc logistic binomial”),它看起来应该这样做: proc genmod data=beetle; model dead/total=dose / link=logit dist=binomial; 基于此 ,看起来您的上述数据实际上与上面链接中提到的标准Bliss(1935)数据集相同。 Based on this SAS document (google "sas proc logistic binomial") it looks li ... -
SAS自动邮件无法正常工作(SAS automail not working)[2022-09-25]
问题是你实际上并没有调用宏。 您只在定义 %macro时使用%macro宏。 要调用它,只需在宏名称前面加上%符号,如下所示: %mailing() The issue is that you are not actually calling the macro. You only use %macro when defining a macro. To call it, simply precede the macro name with a % symbol, as follows: %mailing ...