cancel
Showing results for 
Search instead for 
Did you mean: 

Want to count repeated words from a MS word file

NiteshMishra
Level 3
Hello Team, I want to count repeated words from a MS word file. Please guide me how to do that.
3 REPLIES 3

Mustafa_UlasYig
Level 6
Hi Nitesh. I created a process using ""utility - Strings"" - split text action and ""utility - Collection Manipulation"" VBO's to count distinctive terms from text. I modified the ""MS Word VBO"" - Copy to Clipboard action code to include this code: ""output = Len(s.text)"", so that I can use the ""Get Body action from the MS Word VBO, that requires the start and finish (characters). This is only a suggestion as to how you can grab text from word, there are probably more than one way to do this. See enclosed file for my take on how to count repeated words and how to grab text from a word document. Good luck. BR, Mustafa

NiteshMishra
Level 3
Many Thanks Sir for the suggestion, I will try using your solution.

Mustafa_UlasYig
Level 6
No problem sir. Here is an updated version, as it fails, when you do not remove line-feeds from the text. This version removes line-feeds, hyphens, commas and punctuation, you can choose to remove the others, just not the removal of line-feeds. It is way fast(er) when you run the process from the control room. But that said, this could probably be (a bit) faster when and if you wrote some vbnet/c# code instead. See updated version attached. Good luck :) BR, Mustafa