Sandeep,

You can use the <move> task to rename files, as in <move file="original.name" tofile="new.name" />
http://nant.sourceforge.net/release/latest/help/tasks/move.html

Unfortunately to use this renaming behaviour you can only specify a single file, not a fileset (see the documentation for details).  You can still achieve your desired renaming behaviour using a loop...

<foreach item="File" property="fname">
  <in>
    <items refid="envfileset" />
  </in>
  <do>
    <property name="newfname" value="${string::replace(fname, ENVNAME, '')}" />
    <echo level="Verbose" message="Moving &quot;${fname}&quot; to &quot;${newfname}&quot;" />
    <move file="${fname}" tofile="${newfname}" overwrite="true" />
  </do>
</foreach>


Hope that helps,


--
Troy

Reply via email to