frequency of word
2 posters
Page 1 of 1
frequency of word
you have to write a script to count the frequency of a particular word in given file?
Re: frequency of word
awk 'BEGIN{search_string = <whatever>}
{for(i=1;i<=NF;i++)
if($i == search_string)
count++;
}
END {print count}' <file>
{for(i=1;i<=NF;i++)
if($i == search_string)
count++;
}
END {print count}' <file>
Beagle- Posts : 9
Join date : 2008-08-11
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum