ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Sadangi <msada...@manh.com>
Subject RE: replacetokens is not working
Date Tue, 13 May 2003 20:13:37 GMT
Hi Peter,
got it working with replacefile

thanks, 
manoj 


-----Original Message-----
From: peter reilly [mailto:peter.reilly@corvil.com]
Sent: Tuesday, May 13, 2003 10:44 AM
To: Ant Users List
Subject: Re: replacetokens is not working


Hi Manoj,
My test build.xml is:
<project default="t">
  <target name="t">
    <concat destfile="x.p">
      com.apache.tools
      com.peter
      ctshisom.r
    </concat>
    <loadfile srcfile="x.p" property="x">
      <filterchain>
        <replacetokens begintoken="c" endtoken="m">
          <token key="o" value="org"/>
        </replacetokens>
      </filterchain>
    </loadfile>
    <echo>${x}</echo>
  </target>
</project>

and the output is:
t:
     [echo]
     [echo]       org.apache.tools
     [echo]       org.peter
     [echo]       ctshisom.r
     [echo]

ant version 1.5.3-1.

Peter.

On Tuesday 13 May 2003 15:09, Manoj Sadangi wrote:
> Hi Peter,
>    I tried the begintoken and endtoken but it did not work.
>
> thanks,
> manoj sadangi
>
>
> -----Original Message-----
> From: peter reilly [mailto:peter.reilly@corvil.com]
> Sent: Tuesday, May 13, 2003 10:05 AM
> To: Ant Users List
> Subject: Re: replacetokens is not working
>
>
> "replacetokens" needs a begintoken and endtoken
> attribute. These default to "@".
> You may do:
>
>          <replacetokens begintoken="c" endtoken="m">
>                    <token key="o" value="org"/>
>         </replacetokens>
>
>
> In ant 1.6 alpha, there is a new filter replacestring.
>
> <loadfile ..>
>    <filterchain>
>       <linecontains>
>           <contains value="pathmgr">
>      </linecontains>
>      <replacestring from="org" to="org"/>
>   </filerchain>
> </loadfile>
>
> Peter
>
> On Tuesday 13 May 2003 14:19, Manoj Sadangi wrote:
> > I am parsing a property file and trying to replace all the occurance of
>
> com
>
> > with org.
> > <loadfile srcfile="${path.propertyfile}" property="pf">
> >   <filterchain>
> >    <linecontains>
> >   	<contains value="pathmgr"/>
> >    </linecontains>
> >  <replacetokens>
> >       <token key="com" value="org"/>
> >    </replacetokens>
> >   </filterchain>
> > </loadfile>
> >
> > this is returning a single line com.foo.foobar.main
> > so the linecontain filter is working but the replacetoken is not
working.
> >
> > any help would be appreciated.
> >
> > thanks,
> > manoj
> > ---------------------------------------------------------------------
> > 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
>
> ---------------------------------------------------------------------
> 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


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

Mime
View raw message