ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter West <li...@pbw.id.au>
Subject Re: Extracting individual tokens after using stringtokenizer
Date Mon, 25 May 2015 13:28:28 GMT
Have a look at this and see if it helps.

http://codepulsive.blogspot.com.au/2013/05/ant-process-elements-in-list.html

Peter
“…we hear them telling in our own tongues the might works of God."


> On 25 May 2015, at 9:58 pm, WebServices Development <WebServices_Development@csx.com>
wrote:
> 
> I am trying to extract individual tokens in ANT after using stringtokenizer to separate
the tokens out.  Is it possible? How do I do it without using any other external ant libraries
like ant-contrib?
> 
> I attempted to do below, but am stuck at extracting individual tokens
> 
> <property name="dirlist" value="./src:./.apt_generated:abc" />
> <loadresource property="dirseplist">
>     <string value="${dirlist}" />
>     <filterchain>
>           <tokenfilter>
>           <stringtokenizer  delims=":" id="dirliststr"/>
>           <replaceregex pattern="(.+)" replace="[\1]" />
>           </tokenfilter>
>     </filterchain>
> </loadresource>
> <echo level="info" message="dirlist: '${dirlist}'" />
> <echo level="info" message="dirseplist : '${dirseplist}'" />
> 
> And the output is
>    [echo] dirlist: './src:./.apt_generated:abc'
>    [echo] dirseplist : '[./src]:[./.apt_generated]:[abc]'
> 
> Thanks


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


Mime
View raw message