Search multiple words in txt file

  • Thread starter Thread starter extream87
  • Start date Start date
E

extream87

Guest
Hello, how can i make to search multiple keywords in a txt file line by line using an txt with my keywords and make output in another txt file for example keyword used & count

Private Sub Counter()
Dim Lookfor() As String = (txtfilewithmykeywords.txt)
Dim count As Integer
For Each line As String In File.ReadAllLines("C:\Users\walle\test.txt")
If Lookfor.IndexOf(line, 0, StringComparison.CurrentCultureIgnoreCase) > -1 Then
count = count + 1
End If
Next
Here i want to create an .txt file with keyword used and count
End Sub

Continue reading...
 
Back
Top