ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thilo boehm <thilo.bo...@gmail.com>
Subject Re: rename file with mapper
Date Tue, 10 Aug 2004 19:02:10 GMT
Thanks a lot for your help.
It looks like the mapper only works in the current directory, but I
want to rename the files recursively. I always looked at a deeper
directory, that's why I thought the task is not working.
Any ideas?

-Thilo


On Tue, 10 Aug 2004 13:02:08 -0400, Saha, Sanjeev <ssaha@asce.org> wrote:
> Here is a sample build file that I used to test your concern. It works perfectly fine
for your needs. Surprisingly, it is not much different than the one that you are trying to
use. Hope it helps!!
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project basedir="." default="rebuild" name="test">
>  <property name="dir" value="."/>
>  <target name="rename">
>    <move todir="${dir}" includeemptydirs="false">
>      <fileset dir="${dir}" includes="**/*"/>
>      <mapper type="glob" from="LIVE_*" to="*"/>
>    </move>
>  </target>
>  <target name="rebuild" depends="rename"/>
> </project>
> 
> -Sanjeev
> 
> 
> 
> 
> -----Original Message-----
> From:   thilo boehm [mailto:thilo.boehm@gmail.com]
> Sent:   Tue 8/10/2004 11:10 AM
> To:     user@ant.apache.org
> Cc:
> Subject:        rename file with mapper
> Hello everbody,
> 
> I am trying to rename some files with ANT 1.6.1 using the a matcher.
> 
> LIVE_filename.txt should be filename.txt
> 
> I tried:
> 
>  <move todir="${dir}" >
>    <fileset dir="${dir}">
>      <include name="**/*"/>
>    </fileset>
>    <mapper type="glob" from="LIVE_*" to="*"/>
>  </move>
> 
> and
> 
>  <move todir="${dir}" >
>    <fileset dir="${dir}">
>      <include name="**/*"/>
>    </fileset>
>    <mapper type="regexp" from="LIVE_(.*)" to="\1" />
>  </move>
> 
> without luck. Any help is appreciated.
> It works, if the pattern is at the end of the filename, but not an the
> beginning.
> 
> Bye,
>  Thilo
> 
> --
> - thilo boehm - www.tboehm.de - thilo/web/gmail -
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
> 


-- 
- thilo boehm - www.tboehm.de - thilo/web/gmail -

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


Mime
View raw message