Paul S Person
2019-01-01 03:17:41 UTC
Given this input file in directory
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs:
4c4
< %%CreationDate: 11:00:26 December 31, 2018
---
wgrep -c \^>
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
and this works:
wgrep -c \^<
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
in both cases producing:
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs\c_readme.txt
Lines: 1
but what I want is to catch both cases, that is, to show "Lines: 2".
This form
wgrep -c (\^<|\^>)
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
produces
'\>)' is not recognized as an internal or external command,
operable program or batch file.
and this form
wgrep -c [\^<\^>]
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
produces no output.
These are all at the command line, for easy testing, but I /really/
want it to work inside a BAT file.
Any ideas on how to get wgrep to count both lines starting with "<"
and those starting with ">"?
Both must be checked because diff only output one line if a new line
is added or an old line is deleted.
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs:
4c4
< %%CreationDate: 11:00:26 December 31, 2018
---
%%CreationDate: 22:24:22 November 1, 19115
This works (it should be all on one line, of course):wgrep -c \^>
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
and this works:
wgrep -c \^<
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
in both cases producing:
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs\c_readme.txt
Lines: 1
but what I want is to catch both cases, that is, to show "Lines: 2".
This form
wgrep -c (\^<|\^>)
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
produces
'\>)' is not recognized as an internal or external command,
operable program or batch file.
and this form
wgrep -c [\^<\^>]
C:\Users\Paul\Documents\ProgDev\Cpp\owTest\wgml\DOCS\diffs
produces no output.
These are all at the command line, for easy testing, but I /really/
want it to work inside a BAT file.
Any ideas on how to get wgrep to count both lines starting with "<"
and those starting with ">"?
Both must be checked because diff only output one line if a new line
is added or an old line is deleted.
--
"I begin to envy Petronius."
"I have envied him long since."
"I begin to envy Petronius."
"I have envied him long since."