ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Replacing text in files
Date Fri, 25 May 2007 11:57:29 GMT
 
-----Original Message-----
From: Lars Monsees [mailto:l.monsees@atlantisgmbh.de] 
Sent: Friday, May 25, 2007 1:50 PM
To: user@ant.apache.org
Subject: Replacing text in files

/*
How can I replace a line from this file with some other text? I thought about "loadfile" or
"patch", but donĀ“t know exactly if these would work.
*/

use a filterchain with replaceregex or replacestring

<move file="path/to/srcfile" tofile="path/to/destfile">
<filterchain>
<tokenfilter>
	<replaceregex pattern="..." replace="..."/>
	<replacestring byline="true" from="\n" to="${line.separator}"/>
</tokenfilter>
</filterchain>
</move>

Regards, Gilbert

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


Mime
View raw message