Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

887.Count and statistics -- How to count the occurrence of a list of words in a text file?

User: editor -- 2011-11-15          << 886  888 >>
Hits: 3999
Type: Count and statistics   
Search all Count and statistics examples
Description:
How to count the number of all pre-defined words in a text file?  
There is a vocabulary file containing one word in each line.  How to count occurrence of each vocabulary word in a text file?
Input Sample:
Vocabulary file: 
word1 
word3 
 
Source text file: 
word1 word1 word2 word5 
word3 word3 word3
Output Sample:
word1: 2 
word3: 3
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Pattern Counter" menu 
2. select "Source" to be "File/http", and select the file to be counted 
3. click "import" to import vocabulary file 
4. check option of "Regular Exp" and "Whole word" 
5. click "count", done, click "copy" to copy all content to clipboard.

Similar Examples:
How to count and sort the occurrence of different numbers in a text file? (76%)
How to replace the content of XML with a list of words from text file? (72%)
How to count the occurrance of some specified words in many files? (72%)
Can I count the frequency of each word in a text file? (72%)
How to replace a word with a list of words repeatly in a text file? (70%)
How to count and sort the frequency of all words appeared in many text files? (67%)
How to count number of words appeared in a text file? (67%)
How to replace the 2nd and 3rd occurrences of some words in multiple files? (66%)

Check Demo of Count and statistics
Keywords:
vocabulary  count occurrence  clipboard  whole word  whole  pattern counter  counter  list of words  define  fine  copy line number  count list word text  word count list  one copy of each file  statistics of number of words  count the number of words in  statistics words in a text  words statistics in text file