ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saha, Sanjeev" <SS...@asce.org>
Subject RE: rename file with mapper
Date Tue, 10 Aug 2004 17:02:08 GMT
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






Mime
View raw message