ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Monsees" <l.mons...@atlantisgmbh.de>
Subject RE: Replacing text in files
Date Tue, 29 May 2007 09:28:57 GMT
Hello,

> /*
> 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
> 

it now works this way:

<target name="version_into_vbp">
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="MajorVer=(.*)" replace="MajorVer=${version.major}"/>
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="MinorVer=(.*)" replace="MinorVer=${version.minor}="/>
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="RevisionVer=(.*)" replace="RevisionVer=${version.revision}="/>
</target>

In case anyone else needs this some time.

Lars


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


Mime
View raw message