List Info

Thread: Counting words




Counting words
user name
2006-04-26 15:43:26
On 4/26/06, Sharp, Craig <quickenloans.com">CraigSharpquickenloans.com> wrote:
I have a file that contains many li˜es.  Here is an example:

evaluate  &nbsp; &nbsp; &nbsp; &nbsp;eaprod  &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;7844 &nbsp; &nbsp; &nbsp; 2  &nbsp; &nbsp;15688 &nbsp; &nbsp;   ; &nbsp;0  &nbsp;   ; &nbsp; 2

...

opncon &nbsp; &nbsp;   ; &nbsp; &nbsp;auditrec  &nbsp; &nbsp; &nbsp; &nbsp;   ;8842  ; &nbsp; &nbsp; 1   ; &nbsp; 8842  &nbsp; &nbsp; &nbsp;  0 &nbsp; &nbsp; &nbsp;   ;1

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.  Example using the above list:

Evaluate 17
Agncyis 1
Opncon 4

I need to do this for each unique word in the first positon.

Where's your code that's not working, and what error (if any), are you getting?

--
pDale Campbell
Desperation = A Rope Ends It
[1]

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