ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saha, Sanjeev" <>
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="*"/>
  <target name="rebuild" depends="rename"/>


-----Original Message-----
From:	thilo boehm []
Sent:	Tue 8/10/2004 11:10 AM
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="**/*"/>
    <mapper type="glob" from="LIVE_*" to="*"/>


  <move todir="${dir}" >
    <fileset dir="${dir}">
      <include name="**/*"/>
    <mapper type="regexp" from="LIVE_(.*)" to="\1" />

without luck. Any help is appreciated.
It works, if the pattern is at the end of the filename, but not an the


- thilo boehm - - thilo/web/gmail -

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message