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

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -