Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 427
Thomas Avatar asked Nov 19 '10 12:11

Thomas


People also ask

How do I batch rename multiple files at once?

Select multiple files in a folder. To do so, press and hold down the CTRL key while you are clicking files. After you select the files, press F2. Type the new name, and then press ENTER.

How do I automatically rename multiple files?

You can press and hold the Ctrl key and then click each file to rename. Or you can choose the first file, press and hold the Shift key, and then click the last file to select a group.

How do I batch rename files in a list?

To batch rename files, just select all the files you want to rename, press F2 (alternatively, right-click and select rename), then enter the name you want on the first file. Press Enter to change the names for all other selected files.

How do I rename a JPEG in bulk?

You can batch rename images in Windows by selecting (Shift+click or Ctrl+click to select several files; Ctrl+A to select all) and pressing right-click > "Rename". Your file names will look like image (1), image (2), image (3) etc.


1 Answers

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.

like image 98
OscarRyz Avatar answered Sep 21 '22 10:09

OscarRyz