|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
count the words that appear more than once in the array
i have a text file with some words in it , i need to print the sorted words and the number of times each word is repeated in the file .
here is what i got , Open App.Path & "\sorted2.txt" For Output As #4 For i = 1 To NumName If nameIn(i) = nameIn(i + 1) Then wordcount(i) = wordcount(i) + 1 Else wordcount(i) = 1 End If Next i For i = 1 To NumName If nameIn(i) <> nameIn(i + 1) Then Print #4, nameIn(i); Tab(50); wordcount(i) End If Next i Close #4 |
|
#2
|
|||
|
|||
|
A possible solution but could be expensive. Once a word is capture place in a redefinable multi array and search that array when the next word is encountered and augment if a match is found.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > count the words that appear more than once in the array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|