You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Manoj Sadangi <ms...@manh.com> on 2003/05/13 15:19:53 UTC
replacetokens is not working
I am parsing a property file and trying to replace all the occurance of com
with org.
<loadfile srcfile="${path.propertyfile}" property="pf">
<filterchain>
<linecontains>
<contains value="pathmgr"/>
</linecontains>
<replacetokens>
<token key="com" value="org"/>
</replacetokens>
</filterchain>
</loadfile>
this is returning a single line com.foo.foobar.main
so the linecontain filter is working but the replacetoken is not working.
any help would be appreciated.
thanks,
manoj
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: replacetokens is not working
Posted by peter reilly <pe...@corvil.com>.
"replacetokens" needs a begintoken and endtoken
attribute. These default to "@".
You may do:
<replacetokens begintoken="c" endtoken="m">
<token key="o" value="org"/>
</replacetokens>
In ant 1.6 alpha, there is a new filter replacestring.
<loadfile ..>
<filterchain>
<linecontains>
<contains value="pathmgr">
</linecontains>
<replacestring from="org" to="org"/>
</filerchain>
</loadfile>
Peter
On Tuesday 13 May 2003 14:19, Manoj Sadangi wrote:
> I am parsing a property file and trying to replace all the occurance of com
> with org.
> <loadfile srcfile="${path.propertyfile}" property="pf">
> <filterchain>
> <linecontains>
> <contains value="pathmgr"/>
> </linecontains>
> <replacetokens>
> <token key="com" value="org"/>
> </replacetokens>
> </filterchain>
> </loadfile>
>
> this is returning a single line com.foo.foobar.main
> so the linecontain filter is working but the replacetoken is not working.
>
> any help would be appreciated.
>
> thanks,
> manoj
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org