You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Aaron Davies <aa...@gmail.com> on 2006/06/14 21:42:02 UTC

Count Lines of Text?

Is there a simple way to count lines of text in a property/file? Not
lines of source code or anything, just raw lines of text, like "wc
-l". I mean, I could probably do something with line terminators, but
I'd rather have something that knows how to count lines properly on
multiple platforms.
-- 
Aaron Davies
aaron.davies@gmail.com

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


Re: Count Lines of Text?

Posted by Aaron Davies <aa...@gmail.com>.
On 6/14/06, Martin Gainty <mg...@hotmail.com> wrote:

> Aaron Davies wrote:
>
> > Is there a simple way to count lines of text in a property/file? Not
> > lines of source code or anything, just raw lines of text, like "wc
> > -l". I mean, I could probably do something with line terminators, but
> > I'd rather have something that knows how to count lines properly on
> > multiple platforms.
>
> grep is your friend
> grep -c '^'  FileName

Not exactly cross-platform, is it? I might as well use "wc -l". I'm
looking for something done in ant itself.
-- 
Aaron Davies
aaron.davies@gmail.com

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


Re: Count Lines of Text?

Posted by Martin Gainty <mg...@hotmail.com>.
Aaron-

grep is your friend
grep -c '^'  FileName

Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Aaron Davies" <aa...@gmail.com>
To: "Ant Users" <us...@ant.apache.org>
Sent: Wednesday, June 14, 2006 3:42 PM
Subject: Count Lines of Text?


> Is there a simple way to count lines of text in a property/file? Not
> lines of source code or anything, just raw lines of text, like "wc
> -l". I mean, I could probably do something with line terminators, but
> I'd rather have something that knows how to count lines properly on
> multiple platforms.
> -- 
> Aaron Davies
> aaron.davies@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>