ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Iwan" <j...@i-ware.net>
Subject RE: [Ant 1.5.4] HowTo rename a set of files?
Date Sun, 22 Feb 2004 17:52:32 GMT
Thanks, that was the right pointer I needed. Here's the code that I'm using
now so others mught benefit from it, or maybe improve on it.

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

Iwan

> -----Original Message-----
> From: Jim Fuller [mailto:jim.fuller@ruminate.co.uk] 
> Sent: Sunday, February 22, 2004 11:17 AM
> To: 'Ant Users List'
> Subject: RE: [Ant 1.5.4] HowTo rename a set of files?
> 
> 
> > From: Iwan [mailto:java@i-ware.net]
> > Sent: 21 February 2004 23:46
> > Subject: [Ant 1.5.4] HowTo rename a set of files?
> 
> > I've got a set of files in a directory:
> > 
> > 	CreateClientForm.jsp
> > 	CreateClientForm.properties
> > 	CreateClientFormContent.jsp
> > 	CreateClientFormTitle.jsp
> > 
> > And I want to rename them to:
> > 
> > 	CreateClient.jsp
> > 	CreateClient.properties
> > 	CreateClientContent.jsp
> > 	CreateClientTitle.jsp
> > 
> > I know I can do this by hand, and even by having multiple
> > move-statements, but I'm sure that Ant can do this for me, I 
> > just don't know how. So hopefully somebody on the list knows how to?
> 
> Use either the glob or probably in your case the regexp file 
> <mapper/> nested within the <move/> or <copy/> task.
> 
> gl, Jim Fuller
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 



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


Mime
View raw message