[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] pcregrep (v8.10 2010-06-25) - win 换行

之前测试了几个 grep.exe,输出的换行都只有换行符而没有回车符。

pcregrep - a grep with Perl-compatible regular expressions.

Usage: pcregrep [OPTION]... [PATTERN] [FILE1 FILE2 ...]
Search for PATTERN in each FILE or standard input.
PATTERN must be present if neither -e nor -f is used.
"-" can be used as a file name to mean STDIN.
All files are read as plain files, without any interpretation.

Example: pcregrep -i 'hello.*world' menu.h main.c

Options:
      --                       terminate options
      --help                   display this help and exit
  -A, --after-context=number   set number of following context lines
  -B, --before-context=number  set number of prior context lines
      --buffer-size=number     set processing buffer size parameter
      --color=option           matched text color option
      --colour=option          matched text colour option
  -C, --context=number         set number of context lines, before & after
  -c, --count                  print only a count of matching lines per FILE
  -D, --devices=action         how to handle devices, FIFOs, and sockets
  -d, --directories=action     how to handle directories
  -e, --regex(p)=pattern       specify pattern (may be used more than once)
  -F, --fixed-strings          patterns are sets of newline-separated strings
  -f, --file=path              read patterns from file
      --file-offsets           output file offsets, not text
  -H, --with-filename          force the prefixing filename on output
  -h, --no-filename            suppress the prefixing filename on output
  -i, --ignore-case            ignore case distinctions
      --no-jit                 ignored: this pcregrep does not support JIT
  -l, --files-with-matches     print only FILE names containing matches
  -L, --files-without-match    print only FILE names not containing matches
      --label=name             set name for standard input
      --line-buffered          use line buffering
      --line-offsets           output line numbers and offsets, not text
      --locale=locale          use the named locale
      --match-limit=number     set PCRE match limit option
      --recursion-limit=number set PCRE match recursion limit option
  -M, --multiline              run in multiline mode
  -N, --newline=type           set newline type (CR, LF, CRLF, ANYCRLF or ANY)
  -n, --line-number            print line number with output lines
  -o, --only-matching=n        show only the part of the line that matched
  -q, --quiet                  suppress output, just set return code
  -r, --recursive              recursively scan sub-directories
      --exclude=pattern        exclude matching files when recursing
      --include=pattern        include matching files when recursing
      --exclude-dir=pattern    exclude matching directories when recursing
      --include-dir=pattern    include matching directories when recursing
  -s, --no-messages            suppress error messages
  -u, --utf-8                  use UTF-8 mode
  -V, --version                print version information and exit
  -v, --invert-match           select non-matching lines
  -w, --word-regex(p)          force patterns to match only as words
  -x, --line-regex(p)          force patterns to match only whole lines

Numbers may be followed by K or M, e.g. --buffer-size=100K.
The default value for --buffer-size is 20480.
When reading patterns from a file instead of using a command line option,
trailing white space is removed and blank lines are ignored.
There is a maximum of 100 patterns, each of maximum size 8192 bytes.

With no FILEs, read standard input. If fewer than two FILEs given, assume -h.
Exit status is 0 if any matches, 1 if no matches, and 2 if trouble.


----------------------------------------
http://code.google.com/p/cppstor ... 32/bin/pcregrep.exe
http://code.google.com/p/srgb/downloads/detail?name=pcre8.20.7z
----------------------------------------
http://pan.baidu.com/share/link?shareid=238863362&uk=1124163200

返回列表