Ant task to find and replace in property value -


ant task "replace" find-and-replace in contents of file. can used (or there other task) work directly on property value.

e.g. want find ampersand property value , replace other string. achieve in multiple steps.

 <property name="prop_before" value="abc&pqr" />  <echo  file="propfile" message="${prop_before}" />  <replace file="propfile" token="&amp;" value="esacape_and" />  <loadfile property="prop_after" srcfile="propfile"/> 

is there ant task below ?

<replace source_property="prop_before"           destination_property="prop_after"           token="&amp;"           value="esacape_and"   /> 

if can add external libraries, it's simplest use propertyregex ant-contrib project:

<propertyregex property="pack.name"           input="package.abc.name"           regexp="(package)\.[^\.]*\.(name)"           replace="\1.def.\2"           casesensitive="false" /> 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -