How to rename n files with ANT? (Batch Job)

旧街凉风 提交于 2019-12-22 01:38:11

问题


How can I rename 1..n file with ANT? I would like to rename any files with xxxx.default.properties to xxxx.local.properties.

Thank you.


回答1:


Using the move task you could do something like this:

  <move todir="my/src/dir" includeemptydirs="false">
    <fileset dir="my/src/dir"/>
    <mapper type="glob" from="*.default.properties" to="*.local.properties"/>
  </move>

Give it a try and let us know.




回答2:


Use the move-task. There is also an example how to rename a set of files (last examples).



来源:https://stackoverflow.com/questions/4224995/how-to-rename-n-files-with-ant-batch-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!