ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Parsing comma-separated string and getting handle to each token
Date Mon, 23 Nov 2009 11:09:44 GMT
<loadfile property="data" srcfile="my.txt"/>
<ac:for param="line" list="${data}" delimiter="${line.separator}">
    <ac:for param="value" list="@{line}" delimiter=",">


>-----Urspr√ľngliche Nachricht-----
>Von: rohit15 [] 
>Gesendet: Montag, 23. November 2009 11:07
>Betreff: Parsing comma-separated string and getting handle to 
>each token
>Hi gurus,
>Can you please help me resolve this seemingly simple requirement.
>I have a my.txt file like
>I need to parse this line by line and then process each line. While
>processing each line, I need to execute separate logic on the 
>2nd and 3rd
>variables of each line.
>I've been able to parse each line using the following code. However, I
>haven't succeeded in getting handle to 2nd and 3rd variables 
>by reference 
>[For e.g. in Java, I'd have iterated using stringtokenizer and 
>referred as
>stringtkr.token[1], or token[2]  -something on those lines]
><macrodef name="printline">
><attribute name="lineparam"/>
><echo>Line param :: @{lineparam}</echo>
><for list="@{lineparam}" param="testparam" delimiter=','>
><property name="@{testparam}" value="This is dummy value for 
><!-- How do I refer specifically to 1st token and then 2nd and 
>then 3rd? -->
>View this message in context: 
>Sent from the Ant - Users mailing list archive at
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message