ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <mlundqui...@comcast.net>
Subject Re: Parsing file. It works but...
Date Fri, 11 Feb 2005 20:49:36 GMT

On Feb 11, 2005, at 12:24 PM, Dick, Brian E. wrote:

> ...there has to be a better way to do this.
>
> I have a file that contains lines like the following.
>
> src1 trg1
> src2
> src3 trg3
>
> 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?

Yeah, I can simplify it to one line of shell:

	sed -e 's/^\([^ ]*\)$/\1 \1/' < the-file | another-program

HTH,
—mark—


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message