Re: Counting occurances of a word in a file.

2011-12-09 Thread Walter Hurry
On Fri, 09 Dec 2011 12:34:45 +0100, Jörg-Volker Peetz wrote: > Yes, you are right. My suggestion doesn't work if a word appears more > than once in a line since only lines which contain the word are counted. > Sorry for the confusion. PMFJI. Never mind; *I'm* glad you mentioned it anyway. I have

Re: Counting occurances of a word in a file.

2011-12-09 Thread Jörg-Volker Peetz
Yes, you are right. My suggestion doesn't work if a word appears more than once in a line since only lines which contain the word are counted. Sorry for the confusion. -- Best regards, Jörg-Volker. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe"

Re: Counting occurances of a word in a file.

2011-12-09 Thread afuentes
On Fri, 2011-12-09 at 09:15 +0100, Jörg-Volker Peetz wrote: > With a modern grep version it is even more simple: > > grep -c 'the' /path/to/file.txt i just tested with grep 2.9 and -c and -o does not get along well :) -c only is able to count lines within file and no the lines of output (gener

Re: Counting occurances of a word in a file.

2011-12-09 Thread Jörg-Volker Peetz
With a modern grep version it is even more simple: grep -c 'the' /path/to/file.txt I'm to lazy to look up when this feature was introduced. It works at least with grep version 2.9. -- Best regards, Jörg-Volker. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject

Re: Counting occurances of a word in a file.

2011-12-08 Thread Camaleón
On Thu, 08 Dec 2011 07:53:33 -0800, peasthope wrote: > What is a convenient tool for counting the occurances of a specific byte > sequence in a file? Count the occurances of "the" or %13%10"the " in a > text file for example. Quick and dirty sample: *** grep -o "the" /path/to/file.txt | wc -w

Counting occurances of a word in a file.

2011-12-08 Thread peasthope
What is a convenient tool for counting the occurances of a specific byte sequence in a file? Count the occurances of "the" or %13%10"the " in a text file for example. Thanks,... Peter E. -- New telephone 1 360 639 0202. Old telephone 1 360 450 2132. bcc: peasthope at shaw.