Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using low level commands
Message
De
27/06/2004 19:02:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00917780
Message ID:
00917786
Vues:
9
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform