将 pdfgrep 的输出定向到文件的问题

将 pdfgrep 的输出定向到文件的问题

我正在尝试使用 pdfgrep 搜索多个 pdf 文件中的模式。我正在使用的命令是

pdfgrep --color always <pattern> */*.pdf > outputFile

我将输出定向到文件,因为该命令会产生大量输出。如果我然后输入,cat outputFile我会遇到长行问题,如下所示,即行中存在间隙,并且缺少一些字母和单词:

ARE249/LewandowskyEtAl_PsychSci_2016.pdf:referred to as worldview or cultural cognition—is a major                          because if an overwhelming scientific consensus cannot
ARE249/LewandowskyObenhauerGignac_PsychSci_2016_annot.pdf:referred to as worldview or cultural cognition—is a major                          because if an overwhelming scientific consensus cannot        KIRIVEXIH
ARE249/Lewandowsky_Oberauer_MotivatedRejectionofScience_2016.pdf:apparent than with climate science. The overwhelming                                and Slovic (2013). The tables in panel (a) of Figure 1
ARE249/Lewandowsky_Oberauer_MotivatedRejectionofScience_2016.pdf:    In summary, the rejection of specific scientific evi-                          in panel (b) of Figure 1. Liberals overwhelmingly arrived
ARE249/Lewandowsky_Oberauer_MotivatedRejectionofScience_2016.pdf:to decrease as a result of gun control, whereas they failed                          are motivated to reject an overwhelming scientific con-
ARE249/Mans

bridge_SolnsToPolarization_Ch2_annot.pdf:

一个相关的问题是查看输出文件。如果我将其通过管道传输到more,输出看起来不错,但我真的希望能够在输出中上下滚动。但是,如果我将其通过管道传输,less我会得到很多 ESC,如

ESC[35mESC[KARE249/Kahan_VaccineRisk_2014.pdfESC[mESC[KESC[36mESC[K:ESC[mESC]公共健康等级中的 Kone。该量表上的样本范围得分反映了 ESC[01;3

另一种方法是通过编辑器查看outputFile,但是在这两种情况下,viemacs得到的输出与less.

对于这些问题有人有什么好的解决办法吗?谢谢!

相关内容