List Info

Thread: Counting words




Counting words
user name
2006-04-26 16:02:40
> I need to loop through and find the first word in each
line and count 
> the number of lines that contain this word in the first
position. 

How about this:

$ cat file-with-words | cut -d" " -f1 | sort |
uniq -c

	-Aleksandar
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )