我正在尝试使用pcregrep,如在Cygwin上对这个问题的顶部答案中所指定的那样。我的环境是运行CygwinV1.7.20(0.266/5/3)的Win7 64位。
使用cygcheck -p pcregrep
我得到:
Found 6 matches for pcregrep
libpcre-devel-8.37-1 - libpcre-devel: Perl Compatible Regular Expressions library development (installed binaries and support files)
libpcre-devel-8.37-2 - libpcre-devel: Perl Compatible Regular Expressions library development (installed binaries and support files)
pcre-debuginfo-8.37-1 - pcre-debuginfo: Debug info for pcre (installed binaries and support files)
pcre-debuginfo-8.37-2 - pcre-debuginfo: Debug info for pcre (installed binaries and support files)
pcre-8.37-1 - pcre: Perl Compatible Regular Expressions utilities (installed binaries and support files)
pcre-8.37-2 - pcre: Perl Compatible Regular Expressions utilities (installed binaries and support files)
我尝试使用在本教程中找到的安装pcregrep的说明,但是patch
似乎并不是cygwin安装的一部分。本教程是通过这两个类似于我的问题发现的:所以问题1和所以问题2,引用了它们,因此它们出现在相关的问题部分。这个手册页显示它可以在cygwin中存在,但是尝试运行它的手册页会导致:
$ man pcregrep
No manual entry for pcregrep
pcregrep的库似乎存在于我的cygwin安装中,但我不知道如何编译/提取/使它们能够访问该实用程序。当我尝试运行它时,我会从bash获得标准命令not响应:
$ pcregrep
-bash: pcregrep: command not found
,所以我的问题是:,我在cygwin做什么来允许我使用pcregrep?
我不知道该如何处理,我有数万个日志文件要处理,我需要能够找到三行,每一行与两行之间的行数、这些行中字符串的组成以及它们上方的“标头”行相关联,这些行告诉我接下来有正确的传感器类型信息(一个日志中可以有多个传感器数据,我必须使用一组特定的传感器数据)。如果我不知道如何安装pcregrep (这似乎非常适合这项工作),我将用数据来问潜在的问题。
发布于 2016-01-30 11:08:18
您的cygcheck -p
查询表明在这三个包中提到了pcregrep
。在线包浏览器确认pcregrep.exe
二进制文件在pcre
包中是可用的:您不必编译任何东西。
首先,使用Cygwin安装程序setup-x86.exe
(32位Cygwin)或setup-x86_64.exe
(64位Cygwin)来安装该软件包:当您到达"Select“步骤时,在文本类别中找到pcre
,单击New列中的循环图标,直到出现版本号,然后完成安装。如果您不再拥有安装程序,可以从https://cygwin.com/下载它。
https://stackoverflow.com/questions/33418923
复制相似问题