You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jpyork <jp...@hotmail.com> on 2010/10/19 17:04:40 UTC

renaming files

I am wondering if there is a way to take a bunch of files and change the name
of them without having to do them one at a time.

this is an example of what i want to do:

example.jpg (could be html files, css files, etc) to example.1.jpg

I am looking to have files match the build number.  I know i can just copy
the file if I name each one, but there are a few hundred files and this
could make for a ugly looking target.


-- 
View this message in context: http://ant.1045680.n5.nabble.com/renaming-files-tp3219206p3219206.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: renaming files

Posted by jpyork <jp...@hotmail.com>.
disregard...I am a bit sick today..brain a bit slow..figured it out with:

	 <target name="content">
   			 <move todir="mosApp/style" includeemptydirs="false">
   			 <fileset dir="mosApp/style">
   		     <include name="**/*.css"/>
   			 </fileset>
   			 <mapper type="glob" from="*.css" to="*.1.css"/>
  			 </move>
		 </target>
-- 
View this message in context: http://ant.1045680.n5.nabble.com/renaming-files-tp3219206p3219225.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: renaming files

Posted by Michael Shea <mi...@nitido.com>.
I believe you should look here:
http://ant.apache.org/manual/Types/mapper.html

(check out the globmapper).


Mike Shea.

> I am wondering if there is a way to take a bunch of files and change the name
> of them without having to do them one at a time.
>
> this is an example of what i want to do:
>
> example.jpg (could be html files, css files, etc) to example.1.jpg
>
> I am looking to have files match the build number.  I know i can just copy
> the file if I name each one, but there are a few hundred files and this
> could make for a ugly looking target.
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org