ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: How can I count the number of matching patters in a file?
Date Mon, 25 Aug 2003 20:16:24 GMT
What about this?

Implement your own extension of java.io.FilterReader
that counts the characters available from the Reader
passed to its constructor, and buffers the
decimal-formatted String representing the character
count to be returned from its read() method.  Then use
a filterchain something like:

<filterchain>
  <containsregex pattern="mypattern" replace="x"
flags="gs" />
  <filterreader
classname="my.package.CharacterCountingReader" />
</filterchain>

This may work; my apologies if someone else can come
up with a simpler way that doesn't involve scripting. 
;)

-Matt

--- Zsolt Koppany <zkoppanylist@intland.com> wrote:
> Hi,
> 
> how can I count the occurrences of a regular
> expression in a file with
> an ant task?
> 
> Zsolt
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message