Search Results

Search: Posts Made By: sheela
8,612
Posted By rbatte1
tr " " "\n" < input_file | grep -c search_word ...
tr " " "\n" < input_file | grep -c search_word
You could add a -i flag to the grep if you want it case insensitive.

This will split the words on to separate lines. The search_word should really...
8,612
Posted By protocomm
Yes it is a command line awk to find occurrence,...
Yes it is a command line awk to find occurrence, the difference with script of clx is if there are several "am" in a line, i count it.
8,612
Posted By RudiC
With awk, try also awk...
With awk, try also awk '{n+=gsub(/am/,"&")}END{print n}' file
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy