First, you need a function that fetches a word. The foxtools functions, Words() and WordNum(), come in handy here. For quick processing, processing the file one line at a time would probably be faster; for instance, FileToStr() followed by alines(). (I am assuming VFP 6 or later.)
Now, you can create a cursor, and for each word you fetch, you can see if it is already contained in this cursor, or not. If it isn't, add the word to the cursor. If it is, just increase the "count" field.
HTH,
Hilmar.
>hi all-
>
>I new to the thread. I am work on a project that reads in a text file and counts the number of different words and the number of times the same word appears can anyone help me.
>
>Example the 25 times
> do 3 times
> some 1 times
> etc...
>
>
>thanks in advance
>
>james
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)