I don't think so. I had a similar problem and had to resort to a custom script. It's not that difficult though, something along the following lines would do it:
<snip> <?xml version="1.0"?> <project name="example" default="update-file"> <property name="db.user" value="sa" /> <target name="update-file"> <script language="c#"> <code><![CDATA[ public static void ScriptMain(Project project) { string srcDir = Path.Combine(project.BaseDirectory, "web"); string outDir = Path.Combine(project.BaseDirectory, "build"); string dbuser = project.Properties["db.user"]; string srcFile = Path.Combine(srcDir, "web.config"); using (StreamReader reader = File.OpenText(srcFile)) { string contents = reader.ReadToEnd(); contents = contents.Replace("DBUSER", dbuser); string outFile = Path.Combine(outDir, "web.config"); using (StreamWriter writer = new StreamWriter(outFile)) { writer.Write(contents); } } } ]]> </code> </script> </target> </project> </snip> Best wishes, Rodrigo ----- Original Message ----- From: "Shiv Natarajan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 20, 2003 5:24 AM Subject: [Nant-users] Find and Replace task > Is there a 'find and replace in text file' task in > nant. > > Basically, I want to have pre-defined strings in my > web.config file and would like to replace it with > actual values as part of 'deploy' target. > > eg. > // web.config > key="db.user" value="DBUSER" > > // release.xml > <property name="db.user" value="sa"/> > <target name="deploy"> > <find-and-replace > findString="DBUSER" > replaceWith="${db.user}" > ignoreCase="false" > matchWholeWord="true"/> > </target> > > TIA. > - shiv ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users