in reply to count of a word occurrence
1) read the file in a while loop,split and use a hash ($hash{$_}++ ).
2) use someting like the below for all unique entries in the first column.
grep 817 filename | wc -l
hth
chimni
In Section
Seekers of Perl Wisdom