You could use something like... <delete file="filename.txt " />
...for the extraneous file after you've done the parse... ~Robert -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Baker Sent: Friday, July 29, 2005 8:52 AM To: [email protected] Subject: FW: [Nant-users] regex replace So I had never seen the replacestring filter before, that is cool... Any one know what happens if I use the copy task like this <copy file="changeme.txt" tofile="changeme.txt" /> cause I really don't want another file laying around :( Thanks, steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ashley Moran Sent: Friday, July 29, 2005 10:39 AM To: Steve Baker Cc: [email protected] Subject: Re: [Nant-users] regex replace Steve Baker wrote: > I don't see any type of functionality in nant or nantcontrib to find and > replace a string value in a file. > > There is xmlpoke for xml files. How are people doing the same type of > thing for non xml files? > > I wrote a task for this myself a while back, but sometimes clients > prefer to use only publicly supported tasks. > > It went something like this: > > <regex-replace file="filepath" find="regex expression" replace="replace > value" casesensitive="true" /> > > Am I missing something that exists in nant or contrib itself? Why > wouldn't something like this be included? > > Thanks, > > steve I had to do just this today. The standard NAnt tasks <copy> and <move> (and maybe others I haven't noticed) support modifying files via <filterchain>, eg: <copy file="myfile" tofile="mynewfile"> <filterchain> <replacestring from="09-Mar" to="9-3"/> <replacestring from="09-May" to="9-5"/> </filterchain> </copy> Ashley ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Nant-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Nant-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Nant-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users
