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:[EMAIL PROTECTED] Sent: Friday, February 11, 2005 4:09 PM To: Ant Users List Subject: Re: Parsing file. It works but... --- "Dick, Brian E." <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]