frequency of word
Page 1 of 1 • Share •
frequency of word
you have to write a script to count the frequency of a particular word in given file? 
Admin- Admin
- Posts: 39
Join date: 2008-08-03

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-12
Permissions of this forum:
You cannot reply to topics in this forum





