ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Rodriguez <>
Subject wild cards in replace task
Date Fri, 31 Aug 2001 04:09:49 GMT
This question was replied to with a question from another topic.  So I'm
sending it again:

Is it possible to use wildcards in the token attribute of the replace task?
Say I have a file called text.txt that looks like this:

line1="blah blah blah"; 
line2="something else";

Now I want to use a replace task in my build.xml that looks like:
<target name="replace"">
<replace file="text.txt" value="line1=&quot; ${} &quot;;">
<replacefilter token="line1=&quot; * &quot;;"/>

I want to use the * because I want to replace the whole line with a new
line.  I won't always know the exact text in text.txt, so it would be more
useful just to replace a whole line.  Is there a way to do this (I tried the
* and it didn't work)?  I tried to look for docs on replacefilter but I
couldn't find any.  Any help would be greatly appreciated.


View raw message