find replace text in file with Phing -
does know how find , replace text inside file phing?
the simplest way achieve using 'traditional' tools sed
:
sed -i 's/old/new/g' myfile.txt
and if ant-based should help: http://ant.apache.org/manual/tasks/replace.html
the simplest form <replace file="myfile.html" token="old" value="new"/>
.
and if need it, run external tools ant explained @ http://ant.apache.org/manual/tasks/exec.html, means among other things call sed ant like:
<exec executable="sed"> <arg value="s/old/new/g" /> <arg value="$my_file" /> </exec>
Comments
Post a Comment