I use propertyregex with the help of a macro:
  <!-- *********************************************
       Macro to set a property to the first
       group of a regexp applied on an input string.
       ********************************************** -->
  <macrodef name="regset1">
    <attribute name="regexp"/>
    <attribute name="input"/>
    <attribute name="property"/>
    <sequential>
      <ac:propertyregex override="yes"
                        property="@{property}"  input="@{input}"
                        regexp="@{regexp}" replace="\1"/>
    </sequential>
  </macrodef>

          <regset1 property="program" input="@{file}"
                  regexp=".*/([^\.]*)\.cpp"/>

In this case I am using the /dir/dir/dir/x.cpp name and
extracting the x as the program name.


On 3/21/06, Ivan Rambius Ivanov <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> In your case you can use <basename> to get the name of
> the file. For more sophisticated operations on paths
> you may find useful <pathconvert> with nested
> <mapper>.
>
> Regards
> Ivan
>
> --- ar81 <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > When I write the following loop, I get absolute file
> > pathes.
> >
> >       <for param="file">
> >           <path>
> >              <fileset dir="${work.dir}"
> > includes="**/*.xml"/>
> >           </path>
> >           <sequential>
> >              <echo message="File : @{file}" />
> >           </sequential>
> >        </for>
> >
> > C:\Temp\dir1\file1.xml
> > C:\Temp\dir1\file2.xml
> > C:\Temp\dir1\file3.xml
> >
> > where work.dir=C:\Temp\dir1
> >
> > I'd like to get :
> > file1.xml
> > file2.xml
> > file3.xml
> >
> > Does anybody know how to transform absolute pathes
> > to relative pathes ?
> >
> > Thanks
> >
> > A. ROY
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to