Does anyone know how to find and replace text inside a file with Phing?
The simplest way to achieve this using 'traditional' tools would be sed
:
sed -i 's/old/new/g' myfile.txt
And if it is ant-based then this should help: http://ant.apache.org/manual/Tasks/replace.html
The simplest form would be
.
And if you really need it, you could run external tools with ant as documented at http://ant.apache.org/manual/Tasks/exec.html, which means that among other things you could, for example, call sed from ant with something like: