Re: Extracting individual tokens after using stringtokenizer

Peter West <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
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 <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.