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

Reply via email to