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 |