ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WebServices Development <WebServices_Developm...@csx.com>
Subject RE: Extracting individual tokens after using stringtokenizer
Date Mon, 25 May 2015 18:48:08 GMT
Thanks. I had seen that link before, but it seems to be overly complicated for getting individual
tokens out when I am able to separate them using stringtokenizer.  Isn't there any other simplere
way to do what I am after?


-----Original Message-----
From: Peter West [mailto:lists@pbw.id.au] 
Sent: Monday, May 25, 2015 9:28 AM
To: Ant Users List
Subject: Re: Extracting individual tokens after using stringtokenizer 

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




This email transmission and any accompanying attachments may contain CSX privileged and confidential
information intended only for the use of the intended addressee. Any dissemination, distribution,
copying or action taken in reliance on the contents of this email by anyone other than the
intended recipient is strictly prohibited. If you have received this email in error please
immediately delete it and notify sender at the above CSX email address. Sender and CSX accept
no liability for any damage caused directly or indirectly by receipt of this email.
Mime
View raw message