ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Parsing file. It works but...
Date Mon, 14 Feb 2005 18:03:44 GMT
That's much better.

<target name="test">
   <for param="line">
      <FileLineIterator file="test_list.txt"/>

      <sequential>
         <propertyregex property="source"
                        input="@{line}"
                        regexp="^([^ ]*).*"
                        select="\1"
         />

         <propertyregex property="target"
                        input="@{line}"
                        regexp="^(.+)\s(.+)$"
                        select="\2"
         />

         <property name="target" value="${source}"/>

         <echo>Process Source=${source} Target=${target}</echo>

         <var name="source" unset="true"/>
         <var name="target" unset="true"/>
      </sequential>
   </for>
</target>

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
Sent: Friday, February 11, 2005 5:19 PM
To: Ant Users List
Subject: RE: Parsing file. It works but...


--- Matt Benson <gudnabrsam@yahoo.com> wrote:

> --- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
> 
> > That's a bit better.
> > 
> > Is there a better way to iterate the lines in the
> > file? The <for> task
> > docs say any type that has a public iterator() can
> > be used. Is there
> > such a type for file iteration?
> 
> There is now.

To clarify, this class implements Iterator directly
'cause I couldn't think of a good name for something
to return such an iterator.  But since for will accept
an iterator directly, it's just as good.  I have
actually tested this and it works for me.

-Matt

> 
> HTH,
> Matt
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Meet the all-new My Yahoo! - Try it today! 
> http://my.yahoo.com 
>  
> 
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
user-help@ant.apache.org


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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