Im trying to count the number of occurences of the line "Does this buildlist need compile: true" in a file. I tried the following code, but it does not pick up the count
<concat>
<fileset file="@{logPathInTestSetup}" />
<filterchain>
<tokenfilter>
<ct:countfilter property="noOfCompiledBuildlists" contains="Does this buildlist need compile:\s*(true)" override="true">
<ct:counteach propertyprefix="count." select="\1" />
</ct:countfilter>
</tokenfilter>
<ct:stopfilter />
</filterchain>
</concat>
When I try counting "Does this buildlist need compile:", the counter works and I get the correct value. So there is definitely a problem with the regex. Can someone please help? Thanks, Aarthi
You don't need some extra task, but Ant 1.7.1+ as
<concat>
has to be resource.Here's a slightly adapted example from ant manual resourcecount
given input, foobar.txt :
example ant script :
output :
EDIT
To get the lines that do not match, means negate your regex, simply use :