Are you actually doing something with the properties before doing the
replace? If not, you could use a filter. Unfortunately, <property> doesn't
support the filter directly, but you could copy the property file, then use
the <property file="xxx"/> to point to your copy:

<copy file="orig.properties"
   tofile="new.properties">
   <filterset>
        <filter token="sometoken" value="somevalue"/>
   <filterset>
 </copy>
 <properties file="new.properties"/>

Remember that you cannot change a property once it is set! If you do need to
change properties look at the AntContrib <variable> task.

On Nov 27, 2007 7:54 AM, Ognjen Blagojevic <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I need tho read the properties from the file, and then to do a string
> replacement in their values.
>
> Something like this:
>
> 1. read_properties
> 2. do_something_with_properties
> 3. replace_in_property('&', '&amp;')
> 4. do_someting_else_with_escaped_properties
>
> How can I do the step 3?
>
>
> The only solution I came up with is to use ReplaceRegExp task, and write
> escaped properties to another file, and then, reread them. Is there
> anything smarter than that? Something that avoids creation of another
> file?
>
> Regards,
> Ognjen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
David Weintraub
[EMAIL PROTECTED]

Reply via email to