Home » Infrastructure » Unix » Regular Expression Count
Regular Expression Count [message #97715] Wed, 27 November 2002 03:15 Go to next message
Deborah
Messages: 18
Registered: June 2002
Junior Member
Urgently require the following:
I want to find the number of occurences of a word in a
file.

The grep command gives me the number of lines that
contain this word. But one line may contain this word
more than once. I want those repeatitions counted as
well.

TIA,
Debby
Regular Expression Count [message #97844 is a reply to message #97715] Tue, 04 March 2003 10:06 Go to previous messageGo to next message
mac
Messages: 4
Registered: July 2002
Junior Member
I want to find the number of occurences of a word in a
file.
The grep command gives me the number of lines that
contain this word. But one line may contain this word
more than once. I want those repeatitions counted as
well.
Re: Regular Expression Count [message #134550 is a reply to message #97715] Thu, 25 August 2005 09:07 Go to previous message
ashok_rathi
Messages: 1
Registered: August 2005
Junior Member
grep -w "word" t | wc -w
Previous Topic: backup of oracle installation
Next Topic: Determine Encoding Type
Goto Forum:
  


Current Time: Mon Nov 25 21:58:39 CST 2024