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 Fri, 11 Feb 2005 21:43:15 GMT
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?

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



--- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:
[SNIP]
> I need to parse the file and send the two values in
> each line to another
> program. When there is only one value on the line, I
> have to send the
> value twice. Here's the target I wrote to parse the
> file. I looks pretty
> ugly. Can anyone simplify this?

You should be able to modify the regexp you use for
source not to require the space, etc. so that the
pattern is maybe "^([^ ]*).*" or something.  Then
source will be set regardless.  You can set target as
you have been, then avoid the if block by simply
setting target to ${source}, relying on property
immutability.  This could shrink what you've got a
little bit.

HTH,
Matt



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page - Try My Yahoo!
http://my.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