The best way is *not* to do in place replacement.
Have the templates in a source directory and the
results in a target directory, then just use
the copy task with an expandproperties filter in a filterchain:
<project name="expand" default="build">
<property name="companyName" value="woof.com"/>
<target name="build">
<mkdir dir="target"/>
<copy todir="target">
<fileset dir="src" includes="**/*.txt"/>
<filterchain>
<expandproperties/>
</filterchain>
</copy>
</target>
<target name="clean">
<delete dir="target"/>
</target>
</project>
Peter.
On 11/7/07, Rob Wilson <[EMAIL PROTECTED]> wrote:
> Say I have a file with a few files, and would like to inject some
> values via ant properties, i.e. company.txt contains
>
> "Thank you for trying the product from ${companyName}."
>
> Is there an Ant task that given a property entry of
>
> <property name="company.txt" value="woof.com"/>
>
> Will result in company.txt containing
>
> "Thank you for trying the product from woof.com"
>
> Thanks,
> Rob.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]