You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Saladin Sharif <al...@yahoo.com> on 2007/10/09 00:20:25 UTC

How to get the count of the number of lines in a file using ANT

I have a txt file and would like to get the count of the number of lines in that file, and then store that count into a property.

I mean something equivalent to the unix command:
cat file_name.txt | wc -l

Can this be done using an existing ANT task?
Thanks,
-Saladin


       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

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


Re: How to get the count of the number of lines in a file using ANT

Posted by David Weintraub <qa...@gmail.com>.
All right. You win, we believe you. Now, can you show us a coding
example. I can see how you can use tokens for grep and sed, but not
for "wc -l".

On 10/9/07, Matt Benson <gu...@yahoo.com> wrote:
> Oh, ye of little faith... Look at:
>
> http://ant.apache.org/manual/CoreTypes/resources.html#tokens
>
> for a hint...
>
> -Matt
>
> --- Prashant Reddy <pr...@pramati.com> wrote:
>
> > Ok, none of the named filters that exist in ANT dist
> > can help achieve
> > this. You might need to use the scriptfilter, and i
> > am not an expert in
> > using scripting lang.
> >
> > -Prashant
> >
> > On Tue, 2007-10-09 at 11:09 +0530, Prashant Reddy
> > wrote:
> > > checkout the filterchains:
> > >
> > >
> >
> http://ant.apache.org/manual/CoreTypes/filterchain.html
> > >
> > >
> > > On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif
> > wrote:
> > > > I have a txt file and would like to get the
> > count of the number of lines in that file, and then
> > store that count into a property.
> > > >
> > > > I mean something equivalent to the unix command:
> > > > cat file_name.txt | wc -l
> > > >
> > > > Can this be done using an existing ANT task?
> > > > Thanks,
> > > > -Saladin
> > > >
> > > >
> > > >
> > > >
> >
> ____________________________________________________________________________________
> > > > Need a vacation? Get great deals
> > > > to amazing places on Yahoo! Travel.
> > > > http://travel.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
> >
> >
>
>
>
>       ____________________________________________________________________________________
> Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
> http://autos.yahoo.com/index.html
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
--
David Weintraub
qazwart@gmail.com

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


Re: How to get the count of the number of lines in a file using ANT

Posted by Matt Benson <gu...@yahoo.com>.
--- Peter Reilly <pe...@gmail.com> wrote:

> On 10/9/07, Matt Benson <gu...@yahoo.com>
> wrote:
> >
> > --- Peter Reilly <pe...@gmail.com>
> wrote:
> >
> > > On 10/9/07, Matt Benson <gu...@yahoo.com>
> > > wrote:
> > > > Oh, ye of little faith... Look at:
> > > >
> > > >
> > >
> >
>
http://ant.apache.org/manual/CoreTypes/resources.html#tokens
> > > >
> > > > for a hint...
> > > It is *not* good to have such things in the
> manual.
> >
> > How not, Peter?
> 
> It is just that examples speak louder than words.
> It a manual saids that it is easy to do something,
> and
> then not show how to do it, and the reader cannot
> figure
> it out easily, it is quite annoying.
> see:
>
http://www.catb.org/~esr/jargon/html/Y/yak-shaving.html

Point taken, but I still can't see how yak-shaving
relates... :|

-Matt

> 
> Peter
> 
> >
> > Anyway, I didn't have time to put together the
> example
> > earlier.  Here goes:
> >
> > <resourcecount>
> >   <tokens><!-- default tokenizer is a line
> tokenizer
> > -->
> >     <file file="file_name.txt" />
> >   </tokens>
> > </resourcecount>
> >
> > -Matt
> >
> > >
> > > Peter
> > >
> > > >
> > > > -Matt
> > > >
> > > > --- Prashant Reddy <pr...@pramati.com>
> wrote:
> > > >
> > > > > Ok, none of the named filters that exist in
> ANT
> > > dist
> > > > > can help achieve
> > > > > this. You might need to use the
> scriptfilter,
> > > and i
> > > > > am not an expert in
> > > > > using scripting lang.
> > > > >
> > > > > -Prashant
> > > > >
> > > > > On Tue, 2007-10-09 at 11:09 +0530, Prashant
> > > Reddy
> > > > > wrote:
> > > > > > checkout the filterchains:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://ant.apache.org/manual/CoreTypes/filterchain.html
> > > > > >
> > > > > >
> > > > > > On Mon, 2007-10-08 at 15:20 -0700, Saladin
> > > Sharif
> > > > > wrote:
> > > > > > > I have a txt file and would like to get
> the
> > > > > count of the number of lines in that file,
> and
> > > then
> > > > > store that count into a property.
> > > > > > >
> > > > > > > I mean something equivalent to the unix
> > > command:
> > > > > > > cat file_name.txt | wc -l
> > > > > > >
> > > > > > > Can this be done using an existing ANT
> task?
> > > > > > > Thanks,
> > > > > > > -Saladin
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > >
> > >
> >
>
____________________________________________________________________________________
> > > > > > > Need a vacation? Get great deals
> > > > > > > to amazing places on Yahoo! Travel.
> > > > > > > http://travel.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
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
____________________________________________________________________________________
> > > > Don't let your dream ride pass you by. Make it
> a
> > > reality with Yahoo! Autos.
> > > > http://autos.yahoo.com/index.html
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > 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
> > >
> > >
> >
> >
> >
> >      
>
____________________________________________________________________________________
> > Check out the hottest 2008 models today at Yahoo!
> Autos.
> > http://autos.yahoo.com/new_cars.html
> >
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



      ____________________________________________________________________________________
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html
 



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


Re: How to get the count of the number of lines in a file using ANT

Posted by Peter Reilly <pe...@gmail.com>.
On 10/9/07, Matt Benson <gu...@yahoo.com> wrote:
>
> --- Peter Reilly <pe...@gmail.com> wrote:
>
> > On 10/9/07, Matt Benson <gu...@yahoo.com>
> > wrote:
> > > Oh, ye of little faith... Look at:
> > >
> > >
> >
> http://ant.apache.org/manual/CoreTypes/resources.html#tokens
> > >
> > > for a hint...
> > It is *not* good to have such things in the manual.
>
> How not, Peter?

It is just that examples speak louder than words.
It a manual saids that it is easy to do something, and
then not show how to do it, and the reader cannot figure
it out easily, it is quite annoying.
see:
http://www.catb.org/~esr/jargon/html/Y/yak-shaving.html

Peter

>
> Anyway, I didn't have time to put together the example
> earlier.  Here goes:
>
> <resourcecount>
>   <tokens><!-- default tokenizer is a line tokenizer
> -->
>     <file file="file_name.txt" />
>   </tokens>
> </resourcecount>
>
> -Matt
>
> >
> > Peter
> >
> > >
> > > -Matt
> > >
> > > --- Prashant Reddy <pr...@pramati.com> wrote:
> > >
> > > > Ok, none of the named filters that exist in ANT
> > dist
> > > > can help achieve
> > > > this. You might need to use the scriptfilter,
> > and i
> > > > am not an expert in
> > > > using scripting lang.
> > > >
> > > > -Prashant
> > > >
> > > > On Tue, 2007-10-09 at 11:09 +0530, Prashant
> > Reddy
> > > > wrote:
> > > > > checkout the filterchains:
> > > > >
> > > > >
> > > >
> > >
> >
> http://ant.apache.org/manual/CoreTypes/filterchain.html
> > > > >
> > > > >
> > > > > On Mon, 2007-10-08 at 15:20 -0700, Saladin
> > Sharif
> > > > wrote:
> > > > > > I have a txt file and would like to get the
> > > > count of the number of lines in that file, and
> > then
> > > > store that count into a property.
> > > > > >
> > > > > > I mean something equivalent to the unix
> > command:
> > > > > > cat file_name.txt | wc -l
> > > > > >
> > > > > > Can this be done using an existing ANT task?
> > > > > > Thanks,
> > > > > > -Saladin
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > >
> >
> ____________________________________________________________________________________
> > > > > > Need a vacation? Get great deals
> > > > > > to amazing places on Yahoo! Travel.
> > > > > > http://travel.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
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> ____________________________________________________________________________________
> > > Don't let your dream ride pass you by. Make it a
> > reality with Yahoo! Autos.
> > > http://autos.yahoo.com/index.html
> > >
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
> >
> >
>
>
>
>       ____________________________________________________________________________________
> Check out the hottest 2008 models today at Yahoo! Autos.
> http://autos.yahoo.com/new_cars.html
>
> ---------------------------------------------------------------------
> 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


Re: How to get the count of the number of lines in a file using ANT

Posted by Matt Benson <gu...@yahoo.com>.
--- Peter Reilly <pe...@gmail.com> wrote:

> On 10/9/07, Matt Benson <gu...@yahoo.com>
> wrote:
> > Oh, ye of little faith... Look at:
> >
> >
>
http://ant.apache.org/manual/CoreTypes/resources.html#tokens
> >
> > for a hint...
> It is *not* good to have such things in the manual.

How not, Peter?

Anyway, I didn't have time to put together the example
earlier.  Here goes:

<resourcecount>
  <tokens><!-- default tokenizer is a line tokenizer
-->
    <file file="file_name.txt" />
  </tokens>
</resourcecount>

-Matt

> 
> Peter
> 
> >
> > -Matt
> >
> > --- Prashant Reddy <pr...@pramati.com> wrote:
> >
> > > Ok, none of the named filters that exist in ANT
> dist
> > > can help achieve
> > > this. You might need to use the scriptfilter,
> and i
> > > am not an expert in
> > > using scripting lang.
> > >
> > > -Prashant
> > >
> > > On Tue, 2007-10-09 at 11:09 +0530, Prashant
> Reddy
> > > wrote:
> > > > checkout the filterchains:
> > > >
> > > >
> > >
> >
>
http://ant.apache.org/manual/CoreTypes/filterchain.html
> > > >
> > > >
> > > > On Mon, 2007-10-08 at 15:20 -0700, Saladin
> Sharif
> > > wrote:
> > > > > I have a txt file and would like to get the
> > > count of the number of lines in that file, and
> then
> > > store that count into a property.
> > > > >
> > > > > I mean something equivalent to the unix
> command:
> > > > > cat file_name.txt | wc -l
> > > > >
> > > > > Can this be done using an existing ANT task?
> > > > > Thanks,
> > > > > -Saladin
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> >
>
____________________________________________________________________________________
> > > > > Need a vacation? Get great deals
> > > > > to amazing places on Yahoo! Travel.
> > > > > http://travel.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
> > >
> > >
> >
> >
> >
> >      
>
____________________________________________________________________________________
> > Don't let your dream ride pass you by. Make it a
> reality with Yahoo! Autos.
> > http://autos.yahoo.com/index.html
> >
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



      ____________________________________________________________________________________
Check out the hottest 2008 models today at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

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


Re: How to get the count of the number of lines in a file using ANT

Posted by Peter Reilly <pe...@gmail.com>.
On 10/9/07, Matt Benson <gu...@yahoo.com> wrote:
> Oh, ye of little faith... Look at:
>
> http://ant.apache.org/manual/CoreTypes/resources.html#tokens
>
> for a hint...
It is *not* good to have such things in the manual.

Peter

>
> -Matt
>
> --- Prashant Reddy <pr...@pramati.com> wrote:
>
> > Ok, none of the named filters that exist in ANT dist
> > can help achieve
> > this. You might need to use the scriptfilter, and i
> > am not an expert in
> > using scripting lang.
> >
> > -Prashant
> >
> > On Tue, 2007-10-09 at 11:09 +0530, Prashant Reddy
> > wrote:
> > > checkout the filterchains:
> > >
> > >
> >
> http://ant.apache.org/manual/CoreTypes/filterchain.html
> > >
> > >
> > > On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif
> > wrote:
> > > > I have a txt file and would like to get the
> > count of the number of lines in that file, and then
> > store that count into a property.
> > > >
> > > > I mean something equivalent to the unix command:
> > > > cat file_name.txt | wc -l
> > > >
> > > > Can this be done using an existing ANT task?
> > > > Thanks,
> > > > -Saladin
> > > >
> > > >
> > > >
> > > >
> >
> ____________________________________________________________________________________
> > > > Need a vacation? Get great deals
> > > > to amazing places on Yahoo! Travel.
> > > > http://travel.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
> >
> >
>
>
>
>       ____________________________________________________________________________________
> Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
> http://autos.yahoo.com/index.html
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: How to get the count of the number of lines in a file using ANT

Posted by Prashant Reddy <pr...@pramati.com>.
Ok, that looks interesting. But I seem to lack the requisite
imagination. :-)

I could not find an example that uses the resources in the ant-book
(Thanks Steve L) either. 

I was thinking along the lines of 

<load file="log.txt" property="count">
 <filterchain>
	<linetokenizer tokens>
 </filterchain>
</load>

-Prashant
On Tue, 2007-10-09 at 05:55 -0700, Matt Benson wrote:
> Oh, ye of little faith... Look at:
> 
> http://ant.apache.org/manual/CoreTypes/resources.html#tokens
> 
> for a hint...
> 
> -Matt
> 
> --- Prashant Reddy <pr...@pramati.com> wrote:
> 
> > Ok, none of the named filters that exist in ANT dist
> > can help achieve
> > this. You might need to use the scriptfilter, and i
> > am not an expert in
> > using scripting lang.
> > 
> > -Prashant
> > 
> > On Tue, 2007-10-09 at 11:09 +0530, Prashant Reddy
> > wrote:
> > > checkout the filterchains:
> > > 
> > >
> >
> http://ant.apache.org/manual/CoreTypes/filterchain.html
> > > 
> > > 
> > > On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif
> > wrote:
> > > > I have a txt file and would like to get the
> > count of the number of lines in that file, and then
> > store that count into a property.
> > > > 
> > > > I mean something equivalent to the unix command:
> > > > cat file_name.txt | wc -l
> > > > 
> > > > Can this be done using an existing ANT task?
> > > > Thanks,
> > > > -Saladin
> > > > 
> > > > 
> > > >        
> > > >
> >
> ____________________________________________________________________________________
> > > > Need a vacation? Get great deals
> > > > to amazing places on Yahoo! Travel.
> > > > http://travel.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
> > 
> > 
> 
> 
> 
>       ____________________________________________________________________________________
> Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
> http://autos.yahoo.com/index.html
>  




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


Re: How to get the count of the number of lines in a file using ANT

Posted by Matt Benson <gu...@yahoo.com>.
Oh, ye of little faith... Look at:

http://ant.apache.org/manual/CoreTypes/resources.html#tokens

for a hint...

-Matt

--- Prashant Reddy <pr...@pramati.com> wrote:

> Ok, none of the named filters that exist in ANT dist
> can help achieve
> this. You might need to use the scriptfilter, and i
> am not an expert in
> using scripting lang.
> 
> -Prashant
> 
> On Tue, 2007-10-09 at 11:09 +0530, Prashant Reddy
> wrote:
> > checkout the filterchains:
> > 
> >
>
http://ant.apache.org/manual/CoreTypes/filterchain.html
> > 
> > 
> > On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif
> wrote:
> > > I have a txt file and would like to get the
> count of the number of lines in that file, and then
> store that count into a property.
> > > 
> > > I mean something equivalent to the unix command:
> > > cat file_name.txt | wc -l
> > > 
> > > Can this be done using an existing ANT task?
> > > Thanks,
> > > -Saladin
> > > 
> > > 
> > >        
> > >
>
____________________________________________________________________________________
> > > Need a vacation? Get great deals
> > > to amazing places on Yahoo! Travel.
> > > http://travel.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
> 
> 



      ____________________________________________________________________________________
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html
 



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


Re: How to get the count of the number of lines in a file using ANT

Posted by Prashant Reddy <pr...@pramati.com>.
Ok, none of the named filters that exist in ANT dist can help achieve
this. You might need to use the scriptfilter, and i am not an expert in
using scripting lang.

-Prashant

On Tue, 2007-10-09 at 11:09 +0530, Prashant Reddy wrote:
> checkout the filterchains:
> 
> http://ant.apache.org/manual/CoreTypes/filterchain.html
> 
> 
> On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif wrote:
> > I have a txt file and would like to get the count of the number of lines in that file, and then store that count into a property.
> > 
> > I mean something equivalent to the unix command:
> > cat file_name.txt | wc -l
> > 
> > Can this be done using an existing ANT task?
> > Thanks,
> > -Saladin
> > 
> > 
> >        
> > ____________________________________________________________________________________
> > Need a vacation? Get great deals
> > to amazing places on Yahoo! Travel.
> > http://travel.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


Re: How to get the count of the number of lines in a file using ANT

Posted by Prashant Reddy <pr...@pramati.com>.
checkout the filterchains:

http://ant.apache.org/manual/CoreTypes/filterchain.html


On Mon, 2007-10-08 at 15:20 -0700, Saladin Sharif wrote:
> I have a txt file and would like to get the count of the number of lines in that file, and then store that count into a property.
> 
> I mean something equivalent to the unix command:
> cat file_name.txt | wc -l
> 
> Can this be done using an existing ANT task?
> Thanks,
> -Saladin
> 
> 
>        
> ____________________________________________________________________________________
> Need a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
-- 

-Prashant

Don't upload, just share : www.dekoh.com


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