Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

484.Count and statistics -- How to count the occurrance of some specified words in many files?

User: editor -- 2010-04-21          << 483  485 >>
Hits: 3266
Type: Count and statistics   
Search all Count and statistics examples
Description:
How to count the occurrance of some specified words in many files?
Input Sample:
some files: 
 
c:\test\file1.txt 
c:\test\file2.txt 
c:\test\file3.txt 
...
Output Sample:
a text file contains following info: 
 
file1.txt word1:80 word2:39 
file2.txt word1:66 word2:5 
file3.txt word1:123 word2:555 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open 'Tools->Batch Runner' window 
2. drag all text files from "Windows File Browser" to "Batch Runner" window 
3. check option of "set output filename", change the following entry to "result.txt" 
4. check option of "Change output folder", change the following entry to a folder you want to put result.txt 
5. click 'Fast Replace' button: 
* click "add",enter "search" like:  
 
* enter "replace" like:  
 
* Make sure "Regular exp" option and "Cross Line" option are selected. 
* Set Write Mode to ">> Append" to join the result to one file. 
6. Click 'Start' button, you will get all count of the words into one file -- result.txt

Screenshot 1:  Batch_Runner_Window


Screenshot 2:  Fast_Replace_Window


Similar Examples:
How to count the occurrence of a list of words in a text file? (72%)
How to count the occurrance of specific pattern in each line of text file? (70%)
How to extract lines containg specified words from many files? (69%)
How to extract all data followed by specified words from many files? (68%)
How to replace the 2nd and 3rd occurrences of some words in multiple files? (65%)
How to count the occurrance of each bytes from 00-FF in a binary file? (65%)
How to find out all specified keywords from a file?
(64%)
How to add bold tag for some specified keywords in multiple html files? (64%)

Check Demo of Count and statistics
Keywords:
occurrance  mode  specified words  write  append  statistics  statist  count and statistics  filename word  ppen  count occurrance  join filename  join many files  statistics words in a text  words statistics in text file  words statistics in text  change a text filename of many files  replace words in filename